diff options
| -rwxr-xr-x | .travis-build.sh | 21 |
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 | ||
| 3 | set -e | 3 | set -e |
| 4 | set -x | 4 | set -x |
| @@ -9,6 +9,25 @@ if grep -nr '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* | |||
| 9 | exit 1 | 9 | exit 1 |
| 10 | fi | 10 | fi |
| 11 | 11 | ||
| 12 | for 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 | ||
| 25 | done | ||
| 26 | |||
| 27 | if [ "$fail" = 1 ]; then | ||
| 28 | exit 1 | ||
| 29 | fi | ||
| 30 | |||
| 12 | #if OS is linux or is not set | 31 | #if OS is linux or is not set |
| 13 | if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then | 32 | if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then |
| 14 | export CC=gcc-6 | 33 | export CC=gcc-6 |