Uncrustify
about uncrustify
- homepage: http://uncrustify.sourceforge.net/
"Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA"
"The goals of this project are simple: Create a highly configurable, easily modifiable source code beautifier."
See sources at Github: https://github.com/uncrustify/uncrustify
current version used
- Currently we still use version 0.56.
our own installer for Windows
it is easier to have an installer for Windows, instead of the zip file provided by the uncrustify project.
- download from http://sourceforge.net/projects/openpetraorg/files/openpetraorg/Tools/Uncrustify-Setup-0.56.exe/download
- the sources for the installer are at https://github.com/openpetra/openpetra/tree/master/setup/tools/uncrustify
Debugging uncrustify
For C# 6 support we noticed that even version 0.62 did not support all new C# 6 features. see https://sourceforge.net/p/uncrustify/bugs/672/ for details.
On Linux, I cloned the git master of uncrustify, to see if those issues had already been fixed there.
git clone https://github.com/uncrustify/uncrustify.git cd uncrustify ./autogen.sh ./configure make
To run the tests:
./run_tests.sh c-sharp
You can add new tests with these steps:
- add an input file to https://github.com/uncrustify/uncrustify/tree/master/tests/input/cs
- add an expected output file to https://github.com/uncrustify/uncrustify/tree/master/tests/output/cs
- add the test in https://github.com/uncrustify/uncrustify/blob/master/tests/c-sharp.test
You can change the log_level to 7 in https://github.com/uncrustify/uncrustify/blob/master/tests/run_tests.py#L84 so that you see the difference of the result of uncrustify compared to your expected output, if the test fails.
If uncrustify has an exception, you only get message like this:
RUN: /home/timotheusp/dev/uncrustify.tpokorra/src/uncrustify -q -c config/ben.cfg -f input/cs/exception-filters.cs > results/cs/10160-exception-filters.cs FAILED: 10160
Then you should run this on the commandline, but without the -q:
cd tests /home/timotheusp/dev/uncrustify.tpokorra/src/uncrustify -c config/ben.cfg -f input/cs/exception-filters.cs > results/cs/10160-exception-filters.cs