cppcheck/runastyle

40 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/bin/bash
# The version check in this script is used to avoid commit battles
2011-06-22 13:20:36 +02:00
# 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."
2011-06-22 13:20:36 +02:00
if [[ "`astyle --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then
echo "You should use: ${ASTYLE_VERSION}";
exit 1;
fi
2011-10-13 20:53:06 +02:00
style="--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0"
2012-10-13 08:18:11 +02:00
options="--pad-header --unpad-paren --suffix=none --convert-tabs"
astyle $style $options cli/*.cpp
astyle $style $options cli/*.h
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"
2013-07-07 11:04:05 +02:00
astyle $style $options htdocs/archive/*.cpp
astyle $style $options htdocs/archive/*.h
# Convert tabs to spaces.. even in strings
# sed -i "s/\t/ /g" test/test*.cpp