From d5263138c3b8b5dea44f6d08ae8b3dbaf6dc0f99 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 21 Jul 2021 12:01:05 -0700 Subject: [PATCH] For perf-frontend-issues#211: add pycodestyle to pre-push hook. --- config/pre-push-recommended.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/config/pre-push-recommended.sh b/config/pre-push-recommended.sh index aae279a29..fa78dc28d 100755 --- a/config/pre-push-recommended.sh +++ b/config/pre-push-recommended.sh @@ -11,10 +11,21 @@ # You can use it by running this command from the project root: # `ln -s ../../config/pre-push-recommended.sh .git/hooks/pre-push` -# Descriptions for each gradle task below can be found in the -# output of `./gradlew tasks`. +set -e -# Run core checks. +# Run linter in tools/ if it's installed. +if `which pycodestyle > /dev/null`; then + pycodestyle tools +fi + +# Run core checks. Descriptions for each gradle task +# below can be found in the output of `./gradlew tasks`. +# +# Tasks omitted because they take a long time to run: +# - assembling all variants +# - unit test on all variants +# - UI tests +# - android lint (takes a long time to run) ./gradlew -q \ ktlint \ detekt \ @@ -23,9 +34,3 @@ mozilla-detekt-rules:test \ mozilla-lint-rules:test \ testDebug - -# Tasks omitted because they take a long time to run: -# - assembling all variants -# - unit test on all variants -# - UI tests -# - android lint (takes a long time to run)