From 20b7d3af6a81de27a490d91c6c9958a79e0b359c Mon Sep 17 00:00:00 2001 From: bneradt Date: Mon, 12 Oct 2020 22:21:33 +0000 Subject: [PATCH] In CI, only run autopep8 on branches that enforce autopep8 --- ci/jenkins/bin/clang-format.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/jenkins/bin/clang-format.sh b/ci/jenkins/bin/clang-format.sh index de9258f8668..dd37eca27b8 100755 --- a/ci/jenkins/bin/clang-format.sh +++ b/ci/jenkins/bin/clang-format.sh @@ -44,8 +44,12 @@ autoreconf -if && ./configure ${ATS_MAKE} clang-format [ "0" != "$?" ] && exit 1 -${ATS_MAKE} autopep8 -[ "0" != "$?" ] && exit 1 +# Only enforce autopep8 on branches where the pre-commit hook was updated to +# check it. Otherwise, none of the PRs for older branches will pass this check. +if grep -q autopep8 tools/git/pre-commit; then + ${ATS_MAKE} autopep8 + [ "0" != "$?" ] && exit 1 +fi git diff --exit-code [ "0" != "$?" ] && exit 1