diff --git a/.astylerc b/.astylerc new file mode 100755 index 000000000..450a57322 --- /dev/null +++ b/.astylerc @@ -0,0 +1,20 @@ +############################################################## +# Documentation is available from # +# http://astyle.sourceforge.net/astyle.html # +############################################################## + +### Options ### +--pad-header +--unpad-paren +--suffix=none +--convert-tabs +--attach-inlines +--attach-classes +--attach-namespaces + +### Settings ### +--style=kr +--indent=spaces=4 +--indent-namespaces +--lineend=linux +--min-conditional-indent=0 diff --git a/runastyle b/runastyle index 074a24186..19fb92234 100755 --- a/runastyle +++ b/runastyle @@ -17,28 +17,27 @@ if [[ "$DETECTED_VERSION" != ${ASTYLE_VERSION}* ]]; then exit 1; fi -style="--style=kr --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0" -options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines --attach-classes --attach-namespaces" +RCFILE=.astylerc -$ASTYLE $style $options cli/*.cpp -$ASTYLE $style $options cli/*.h -$ASTYLE $style $options democlient/*.cpp -$ASTYLE $style $options gui/*.cpp -$ASTYLE $style $options gui/*.h -$ASTYLE $style $options -r gui/test/*.cpp -$ASTYLE $style $options -r gui/test/*.h -$ASTYLE $style $options lib/*.cpp -$ASTYLE $style $options lib/*.h -$ASTYLE $style $options test/*.cpp -$ASTYLE $style $options test/cfg/*.c -$ASTYLE $style $options test/cfg/*.cpp -$ASTYLE $style $options test/*.h +$ASTYLE --options=$RCFILE cli/*.cpp +$ASTYLE --options=$RCFILE cli/*.h +$ASTYLE --options=$RCFILE democlient/*.cpp +$ASTYLE --options=$RCFILE gui/*.cpp +$ASTYLE --options=$RCFILE gui/*.h +$ASTYLE --options=$RCFILE -r gui/test/*.cpp +$ASTYLE --options=$RCFILE -r gui/test/*.h +$ASTYLE --options=$RCFILE lib/*.cpp +$ASTYLE --options=$RCFILE lib/*.h +$ASTYLE --options=$RCFILE test/*.cpp +$ASTYLE --options=$RCFILE test/cfg/*.c +$ASTYLE --options=$RCFILE test/cfg/*.cpp +$ASTYLE --options=$RCFILE test/*.h -$ASTYLE $style $options --recursive "tools/*.cpp" -$ASTYLE $style $options --recursive "tools/*.h" +$ASTYLE --options=$RCFILE --recursive "tools/*.cpp" +$ASTYLE --options=$RCFILE --recursive "tools/*.h" -$ASTYLE $style $options --recursive "samples/*.c" -$ASTYLE $style $options --recursive "samples/*.cpp" +$ASTYLE --options=$RCFILE --recursive "samples/*.c" +$ASTYLE --options=$RCFILE --recursive "samples/*.cpp" # Convert tabs to spaces.. even in strings # sed -i "s/\t/ /g" test/test*.cpp diff --git a/runastyle.bat b/runastyle.bat index 9b28eae59..dc1810457 100644 --- a/runastyle.bat +++ b/runastyle.bat @@ -19,28 +19,27 @@ GOTO EXIT_ERROR ) -@SET STYLE=--style=kr --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0 -@SET OPTIONS=--pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines --attach-classes --attach-namespaces +@SET RCFILE=.astylerc -%ASTYLE% %STYLE% %OPTIONS% cli/*.cpp -%ASTYLE% %STYLE% %OPTIONS% cli/*.h -%ASTYLE% %STYLE% %OPTIONS% democlient/*.cpp -%ASTYLE% %STYLE% %OPTIONS% gui/*.cpp -%ASTYLE% %STYLE% %OPTIONS% gui/*.h -%ASTYLE% %STYLE% %OPTIONS% -r gui/test/*.cpp -%ASTYLE% %STYLE% %OPTIONS% -r gui/test/*.h -%ASTYLE% %STYLE% %OPTIONS% lib/*.cpp -%ASTYLE% %STYLE% %OPTIONS% lib/*.h -%ASTYLE% %STYLE% %OPTIONS% test/*.cpp -%ASTYLE% %STYLE% %OPTIONS% test/cfg/*.c -%ASTYLE% %STYLE% %OPTIONS% test/cfg/*.cpp -%ASTYLE% %STYLE% %OPTIONS% test/*.h +%ASTYLE% --options=%RCFILE% cli/*.cpp +%ASTYLE% --options=%RCFILE% cli/*.h +%ASTYLE% --options=%RCFILE% democlient/*.cpp +%ASTYLE% --options=%RCFILE% gui/*.cpp +%ASTYLE% --options=%RCFILE% gui/*.h +%ASTYLE% --options=%RCFILE% -r gui/test/*.cpp +%ASTYLE% --options=%RCFILE% -r gui/test/*.h +%ASTYLE% --options=%RCFILE% lib/*.cpp +%ASTYLE% --options=%RCFILE% lib/*.h +%ASTYLE% --options=%RCFILE% test/*.cpp +%ASTYLE% --options=%RCFILE% test/cfg/*.c +%ASTYLE% --options=%RCFILE% test/cfg/*.cpp +%ASTYLE% --options=%RCFILE% test/*.h -%ASTYLE% %STYLE% %OPTIONS% -r tools/*.cpp -%ASTYLE% %STYLE% %OPTIONS% -r tools/*.h +%ASTYLE% --options=%RCFILE% -r tools/*.cpp +%ASTYLE% --options=%RCFILE% -r tools/*.h -%ASTYLE% %STYLE% %OPTIONS% -r samples/*.c -%ASTYLE% %STYLE% %OPTIONS% -r samples/*.cpp +%ASTYLE% --options=%RCFILE% -r samples/*.c +%ASTYLE% --options=%RCFILE% -r samples/*.cpp @REM Format configuration files @SET XMLLINT=xmllint