1
0
mirror of https://github.com/ansible/awx.git synced 2026-02-05 09:45:21 +01:00

Only block commits if black fails for certain paths (#14531)

This commit is contained in:
Alan Rominger
2023-10-10 10:12:57 -04:00
committed by GitHub
parent c97a48b165
commit 9745058546

View File

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