791
Comment:
|
1065
Remove "hg uncrustify" docs.
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
The repository contains a Mercurial extension that integrates {{{uncrustify}}} into Mercurial nicely. See ../MercurialUncrustifyExtension. | Not all aspects of source layout are handled by {{{uncrustify}}}, so please still pay attention to our [[../Whitespace]] rules and other [[../CodingConventions]]. |
Line 9: | Line 9: |
Not all aspects of source layout are handled by {{{uncrustify}}}, so please still pay attention to our [[../C++Whitespace]] rules. | == Running uncrustify == To check the formatting of all C++ files, use `./misc/run-uncrustify.py`. To actually edit the files that need to be uncrustified, use `./misc/run-uncrustify.py --modify`. This script is also part of our tox tests: {{{ sudo apt install tox cd misc/ tox -e fix-style }}} To check the style of Python and C++ files, you can use `tox -e style`. |
Back to developer page.
Using uncrustify to fix code layout
We use uncrustify with a Fast Downward configuration file (.uncrustify.cfg in the repository root) to enforce some of our formatting conventions. If a source file is properly formatted, applying uncrustify should be an idempotent operation (i.e., result in an identical file). This is important so that we can verify our style rules automatically, at least for those rules which uncrustify can handle.
Not all aspects of source layout are handled by uncrustify, so please still pay attention to our ../Whitespace rules and other ../CodingConventions.
Running uncrustify
To check the formatting of all C++ files, use ./misc/run-uncrustify.py. To actually edit the files that need to be uncrustified, use ./misc/run-uncrustify.py --modify. This script is also part of our tox tests:
sudo apt install tox cd misc/ tox -e fix-style
To check the style of Python and C++ files, you can use tox -e style.