cppcheck/runastyle

63 lines
1.9 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.
2018-01-08 20:20:33 +01:00
ASTYLE_VERSION="Artistic Style Version 3.0.1"
ASTYLE="astyle"
2011-06-22 13:20:36 +02:00
DETECTED_VERSION=`$ASTYLE --version 2>&1`
if [[ "$DETECTED_VERSION" != ${ASTYLE_VERSION}* ]]; then
echo "You should use: ${ASTYLE_VERSION}";
echo "Detected: ${DETECTED_VERSION}"
exit 1;
fi
RCFILE=.astylerc
$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 --options=$RCFILE --recursive "tools/*.cpp"
$ASTYLE --options=$RCFILE --recursive "tools/*.h"
$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
# format config files
# TODO: use other tool than xmllint? use tabs instead of spaces?
2014-10-16 06:38:18 +02:00
for CFGFILE in cfg/*.cfg
do
xmllint --format -o ${CFGFILE}_ ${CFGFILE}
mv -f ${CFGFILE}_ ${CFGFILE}
done
2018-02-16 09:08:38 +01:00
for PLATFORMFILE in platforms/*.xml
do
xmllint --format -o ${PLATFORMFILE}_ ${PLATFORMFILE}
mv -f ${PLATFORMFILE}_ ${PLATFORMFILE}
done
xmllint --format -o man/cppcheck.1.xml_ man/cppcheck.1.xml
mv -f man/cppcheck.1.xml_ man/cppcheck.1.xml
xmllint --format -o cppcheck-errors_.rng cppcheck-errors.rng
mv cppcheck-errors_.rng cppcheck-errors.rng