From 81266cf7a7c5e8abfa3b91997a0d7570e0a8067f Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 25 Mar 2021 13:25:25 -0400 Subject: [PATCH] only run black on files added or modified in the commit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3813380cf8..6e5e2ee34c 100644 --- a/Makefile +++ b/Makefile @@ -276,7 +276,7 @@ black: reports (set -o pipefail && $@ $(BLACK_ARGS) awx awxkit awx_collection | tee reports/$@.report) .git/hooks/pre-commit: - echo "[ -z \$$AWX_IGNORE_BLACK ] && (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, or set AWX_IGNORE_BLACK=1' && exit 1))" > .git/hooks/pre-commit + echo "[ -z \$$AWX_IGNORE_BLACK ] && (black --check \`git diff --cached --name-only --diff-filter=AM | 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