summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.travis-build.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/.travis-build.sh b/.travis-build.sh
index 80361ddaf..407ea3e55 100755
--- a/.travis-build.sh
+++ b/.travis-build.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3set -e 3set -e
4set -x 4set -x
@@ -9,6 +9,25 @@ if grep -nr '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis*
9 exit 1 9 exit 1
10fi 10fi
11 11
12for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
13 if ! echo "$f" | egrep -q "[.](cpp|h)$"; then
14 continue
15 fi
16 if ! echo "$f" | egrep -q "^src/"; then
17 continue
18 fi
19 d=$(diff -u "$f" <(clang-format "$f"))
20 if ! [ -z "$d" ]; then
21 echo "!!! $f not compliant to coding style, here is the fix:"
22 echo "$d"
23 fail=1
24 fi
25done
26
27if [ "$fail" = 1 ]; then
28 exit 1
29fi
30
12#if OS is linux or is not set 31#if OS is linux or is not set
13if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then 32if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
14 export CC=gcc-6 33 export CC=gcc-6