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