Skip to content

Commit 6ce0dba

Browse files
committed
Add travis style check
1 parent f18979a commit 6ce0dba

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@ language: cpp
33
jobs:
44
include:
55

6+
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
7+
env: NAME="clang-format"
8+
addons:
9+
apt:
10+
packages:
11+
- clang-format-3.8
12+
install:
13+
script: |
14+
# Apparently update-alternatives doesn't work in Travis containers
15+
mkdir -p priority-symlinks
16+
ln -s /usr/bin/clang-format-3.8 priority-symlinks/clang-format
17+
export PATH=${PWD}/priority-symlinks:${PATH}
18+
19+
# Now we can do the formatting pass
20+
clang-format --version
21+
git-clang-format-3.8 "${TRAVIS_BRANCH}"
22+
git diff --color > formatted.diff
23+
if [[ -s formatted.diff ]] ; then
24+
echo 'Formatting error! Apply the following diff and resubmit:'
25+
cat formatted.diff
26+
exit 1
27+
fi
28+
echo 'No formatting errors found'
29+
exit 0
30+
before_cache:
31+
632
- &linter-stage
733
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
834
env: NAME="CPP-LINT"

0 commit comments

Comments
 (0)