Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (29 sloc) 1.256 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/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."

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="--pad-header --unpad-paren --suffix=none"

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"

# Convert tabs to spaces.. even in strings
sed -i "s/\t/ /g" test/test*.cpp
Something went wrong with that request. Please try again.