| I have taken a brief look at ClangFormat. It seems like a nice tool, but it is 
not as customizable as uncrustify and would therefore change many of the style 
conventions that we currently have. For the record, this is the .clang-format 
file that I used (uses YAML format). I have tried to adapt all available 
settings to the values we want and afterwards removed the ones that are 
identical to the LLVM default style.
"""
---
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignTrailingComments: false
AllowShortFunctionsOnASingleLine: Inline
BinPackParameters: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IndentWidth: 4
MaxEmptyLinesToKeep: 2
...
"""
I also tried using a newer uncrustify version. Version 0.61 (the newest release) 
handles C++11 code much better than version 0.59 which we currently use. Version 
0.61 adds some configuration settings and doesn't destroy our syntax.
I created a branch with the new uncrustify settings, manually fixed some lambda 
definitions and an initializer list and afterwards uncrustified the touched 
files. I didn't uncrustify everything to avoid merge conflicts for now. 
Uncrustify preserves the lambda and initializer list syntax and uses the new 
C++11 template syntax and also correctly formats r-value references:
https://bitbucket.org/jendrikseipp/downward/pull-requests/36
Uncrustify 0.59 is the most recent version in any Ubuntu version (up to 15.10), 
so to use uncrustify 0.61, we would have to compile it ourselves. Luckily, this 
is very straightforward (./configure; make).
I'd say we should make the switch to uncrustify 0.61 and explain in the wiki how 
it can be compiled and installed. |