[riot-devel] Coding-conventions: astyle

Christian Mehlis christian at m3hlis.de
Fri Jun 14 21:27:02 CEST 2013


Hey everybody,

I created a astylerc for automated coding style fixing.
It should respect the given rules from:
https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions

[RIOT] $ cat .astylerc
--style=linux
--brackets=attach
--indent=spaces=4
--indent-switches
--indent-labels
--indent-col1-comments
--min-conditional-indent=0
--break-blocks
--pad-oper
--unpad-paren
--break-closing-brackets
--add-brackets
--align-pointer=name

After running this we have a lot changes:
209 files changed, 15148 insertions(+), 12980 deletions(-)

but the code is more readable and maintainable....

If you want to try it: just run the following:
[RIOT] $ find -name '*.c' -or -name '*.h'| xargs astyle

I can also create a pre commit hook to ensure this style!

So what do you guys think?

Christian


More information about the devel mailing list