From f6beb7105d18b544fd13320f70b1082f5bc2afc9 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 23 Mar 2021 10:17:04 -0400 Subject: [PATCH] add the ability to ignore black linting on commit with AWX_IGNORE_BLACK --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1391d741b0..c1655b4ee9 100644 --- a/Makefile +++ b/Makefile @@ -275,7 +275,7 @@ black: reports (set -o pipefail && $@ $(BLACK_ARGS) awx awxkit awx_collection | tee reports/$@.report) .git/hooks/pre-commit: - echo "black --check \`git diff --cached --name-only | grep -E '\.py$\'\` || (echo 'To fix this, run \`make black\` to auto-format your code prior to commit.' && exit 1)" > .git/hooks/pre-commit + echo "black --check \`[ -z \$$AWX_IGNORE_BLACK ] && git diff --cached --name-only | grep -E '\.py$\'\` || (echo 'To fix this, run \`make black\` to auto-format your code prior to commit, or set AWX_IGNORE_BLACK=1' && exit 1)" > .git/hooks/pre-commit chmod +x .git/hooks/pre-commit genschema: reports