cppcheck/runastyle
Mika Attila 10415df93e runastyle: Ignore user's default options file
If we pass --options=none to astyle, it ignores the user's
default options file, and only uses the command line parameters.
This way, if the user has a default options file, it won't conflict
with the style set by the script.
2014-01-16 01:29:33 +01:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# The version check in this script is used to avoid commit battles
# between different developers that use different astyle versions as
# different versions might have different output (this has happened in
# the past).
# If project management wishes to take a newer astyle version into use
# just change this string to match the start of astyle version string.
ASTYLE_VERSION="Artistic Style Version 2.03"
if [[ "`astyle --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then
echo "You should use: ${ASTYLE_VERSION}";
exit 1;
fi
style="--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0"
options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs"
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/*.h
astyle $style $options tools/*.cpp
astyle $style $options --recursive "samples/*.c"
astyle $style $options --recursive "samples/*.cpp"
# Convert tabs to spaces.. even in strings
# sed -i "s/\t/ /g" test/test*.cpp