Skip to content

Commit

Permalink
Only block commits if black fails for certain paths (ansible#14531)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding authored Oct 10, 2023
1 parent c97a48b commit 9745058
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
if [ -z $AWX_IGNORE_BLACK ] ; then
python_files_changed=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.py$')
python_files_changed=$(git diff --cached --name-only --diff-filter=AM awx/ awxkit/ tools/ | grep -E '\.py$')
if [ "x$python_files_changed" != "x" ] ; then
black --check $python_files_changed || \
if [ $? != 0 ] ; then
Expand Down

0 comments on commit 9745058

Please sign in to comment.