[Parted-edge] [PATCH] Create the needed infra-structure to enforce the coding style

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Sat Oct 13 22:36:54 UTC 2007


> uncrustify looks promising:
>
>   Source Code Beautifier for C, C++, C#, D, Java, and Pawn
>   http://uncrustify.sourceforge.net/


Here is the configuration file that I used in the following command:
http://rishi.fedorapeople.org/gnu/gnu-indent.cfg

uncrustify -c /devel/gnu-indent.cfg --replace -l CPP `find . \( -iname
'*.[ch]' -o -iname '*.[ch]pp' -o -iname '*.cc' \) -print`

Here is the effect this has on the C++ code:
http://rishi.fedorapeople.org/gnu/bindings-uncrustify.patch

The GNU style of having "newline between return type and function name
in definition" seems to be problematic since uncrustify is not
differentiating between method declarations and definitions.

Uncrustify comes also with a default set of options for the GNU coding
stadards: http://rishi.fedorapeople.org/gnu/gnu-indent-default.cfg

I tried to keep as close to it as possible.

Comments?

Happy hacking,
Debarshi
-- 
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu



More information about the Parted-edge mailing list