Skip to content

Commit 628c66b

Browse files
committed
Add travis-lint script
This uses $TRAVIS_BRANCH to find the pull-request merge target, and installs the needed Python package.
1 parent 317ffbb commit 628c66b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ matrix:
4040
compiler: clang
4141
env: COMPILER=clang++
4242
- env: NAME="CPP-LINT"
43-
script: scripts/run_lint.sh master HEAD || true
43+
script: scripts/travis_lint.sh || true
4444

4545
script:
4646
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;

scripts/travis_lint.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
script_folder=`dirname $0`
6+
pip install --user unidiff
7+
8+
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
9+
$script_folder/run_lint.sh HEAD~1 # Check for errors introduced in last commit
10+
else
11+
$script_folder/run_lint.sh $TRAVIS_BRANCH # Check for errors compared to merge target
12+
fi
13+

0 commit comments

Comments
 (0)