add the ability to ignore black linting on commit with AWX_IGNORE_BLACK

This commit is contained in:
Ryan Petrello 2021-03-23 10:17:04 -04:00
parent 244d9e70e2
commit f6beb7105d

View File

@ -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