Travis: add astyle

Fetch 3.1 astyle from website (install from ubuntu contains old 2.05).
Print version to verify and run on our codebase
pull/6590/head
Martin Kojtal 2018-02-05 13:53:17 +00:00 committed by Martin Kojtal
parent 1ff77d8dbc
commit f6541f9fc8
1 changed files with 21 additions and 0 deletions

View File

@ -94,6 +94,27 @@ matrix:
# Report success since we have overridden default behaviour
- bash -c "$STATUS" success "Local $NAME testing has passed"
- env:
- NAME=astyle
install:
- wget https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz;
mkdir -p BUILD && tar xf astyle_3.1_linux.tar.gz -C BUILD;
pushd BUILD/astyle/build/gcc;
make;
export PATH=$PWD/bin:$PATH;
popd;
- astyle --version
script:
- find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out;
if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
git --no-pager diff;
echo "Please fix style issues as shown above";
exit 1;
else
echo "Coding style check OK";
exit 0;
fi
- env:
- NAME=events
- EVENTS=events