mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
This means that - we don't have to be always updating the underlying .git/hooks/pre-commit file - updates to the logic will just work automatically - the logic of the black logic has been fixed so that AWX_IGNORE_BLACK=1 should work right now
9 lines
282 B
Bash
Executable File
9 lines
282 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
if [ -z $AWX_IGNORE_BLACK ]
|
|
then
|
|
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)
|
|
fi
|