Uncrustify

From OpenPetra Wiki
Revision as of 19:19, 23 April 2016 by Pokorra (talk | contribs) (Created page with "== 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

about uncrustify

"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.

Extending/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:

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