Skip to content

Commit f6541f9

Browse files
committed
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
1 parent 1ff77d8 commit f6541f9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ matrix:
9494
# Report success since we have overridden default behaviour
9595
- bash -c "$STATUS" success "Local $NAME testing has passed"
9696

97+
- env:
98+
- NAME=astyle
99+
install:
100+
- wget https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz;
101+
mkdir -p BUILD && tar xf astyle_3.1_linux.tar.gz -C BUILD;
102+
pushd BUILD/astyle/build/gcc;
103+
make;
104+
export PATH=$PWD/bin:$PATH;
105+
popd;
106+
- astyle --version
107+
script:
108+
- find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out;
109+
if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
110+
git --no-pager diff;
111+
echo "Please fix style issues as shown above";
112+
exit 1;
113+
else
114+
echo "Coding style check OK";
115+
exit 0;
116+
fi
117+
97118
- env:
98119
- NAME=events
99120
- EVENTS=events

0 commit comments

Comments
 (0)