Preparing repo for semi-automatic code formatting in accordance with project coding style, using the astyle open source tool. Creating README.astyle and 2 astyle config files containing rules for format of .c and .h files
This commit is contained in:
18
README.astyle
Normal file
18
README.astyle
Normal file
@@ -0,0 +1,18 @@
|
||||
Use the _astylerc config file and the 'astyle' util to format the
|
||||
project source files in accordance with the project coding style.
|
||||
|
||||
At project top level run these commands:
|
||||
|
||||
1. To format the .c files:
|
||||
$ find . -type f -name "*.c" | xargs astyle --options=_astylerc-c
|
||||
-OR- (to skip creation of backup files)
|
||||
$ find . -type f -name "*.c" | xargs astyle --options=_astylerc-c -n
|
||||
|
||||
2. To format the .h files:
|
||||
$ find . -type f -name "*.h" | xargs astyle --options=_astylerc-h
|
||||
-OR- (to skip creation of backup files)
|
||||
$ find . -type f -name "*.h" | xargs astyle --options=_astylerc-h -n
|
||||
|
||||
3. To remove the backup file created by astyle:
|
||||
$ find . -type f -name "*.bak" -delete # this are *.c backup files
|
||||
$ find . -type f -name "*.orig" -delete # this are *.h backup files
|
||||
1
_astylerc-c
Normal file
1
_astylerc-c
Normal file
@@ -0,0 +1 @@
|
||||
--style=kr --convert-tabs --indent=spaces=4 --indent-switches --pad-oper --unpad-paren --align-pointer=middle --suffix=.bak --lineend=linux --min-conditional-indent=
|
||||
1
_astylerc-h
Normal file
1
_astylerc-h
Normal file
@@ -0,0 +1 @@
|
||||
--convert-tabs --indent=spaces=4
|
||||
Reference in New Issue
Block a user