forked from AliceO2Group/QualityControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (28 loc) · 878 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
language: cpp
matrix:
include:
- os: linux
dist: xenial
env: TOOL=clang-format
addons:
apt:
sources:
- llvm-toolchain-xenial-7
packages:
- clang-format-7
compiler: clang
script:
- if [[ $TOOL == "clang-format" ]] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
cd $TRAVIS_BUILD_DIR;
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH);
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -i -v LinkDef);
RESULT_OUTPUT="$(git-clang-format-7 --commit $BASE_COMMIT --diff --binary `which clang-format-7` $COMMIT_FILES)";
if [ "$RESULT_OUTPUT" == "no modified files to format" ] || [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then
exit 0;
else
echo "$RESULT_OUTPUT";
exit 1;
fi
fi
notifications:
email: false