aboutsummaryrefslogtreecommitdiffhomepage
path: root/dev/lint-repository.sh
diff options
context:
space:
mode:
authorGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2017-12-06 14:16:08 +0100
committerGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2017-12-06 14:26:32 +0100
commitf1168b816dcbd8ee45787da1251ba5b2a68176d5 (patch)
tree8eb2077ac6bad8dda4cee6707a684e8e482ae015 /dev/lint-repository.sh
parent2c5e81e3bc6ec17d253aeedd1b2bf4ccd3b81933 (diff)
Linter: skip PRs older than the linter.
Diffstat (limited to 'dev/lint-repository.sh')
-rwxr-xr-xdev/lint-repository.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/dev/lint-repository.sh b/dev/lint-repository.sh
index ecf7880e2..87a829746 100755
--- a/dev/lint-repository.sh
+++ b/dev/lint-repository.sh
@@ -11,6 +11,13 @@ CODE=0
if [ "(" "-n" "${TRAVIS_PULL_REQUEST}" ")" "-a" "(" "${TRAVIS_PULL_REQUEST}" "!=" "false" ")" ];
then
+ # skip PRs from before the linter existed
+ if [ -z "$(git ls-tree --name-only "${TRAVIS_PULL_REQUEST_SHA}" dev/lint-commits.sh)" ];
+ then
+ 2>&1 echo "Linting skipped: pull request older than the linter."
+ exit 0
+ fi
+
# Some problems are too widespread to fix in one commit, but we
# can still check that they don't worsen.
CUR_HEAD=${TRAVIS_COMMIT_RANGE%%...*}