Compare commits

...

1 commit

Author SHA1 Message Date
Aurélien Delobelle
83faf417c9 core -- Fix pre-commit hook, cmd see many args 2018-10-06 23:19:41 +02:00

View file

@ -24,7 +24,7 @@ if type black &>/dev/null; then
touch $BLACK_OUTPUT
if ! black --check "$STAGED_PYTHON_FILES" &>$BLACK_OUTPUT; then
black "$STAGED_PYTHON_FILES" &>$BLACK_OUTPUT
black $STAGED_PYTHON_FILES &>$BLACK_OUTPUT
tail -1 $BLACK_OUTPUT
formatter_updated=1
else
@ -48,7 +48,7 @@ if type isort &>/dev/null; then
touch $ISORT_OUTPUT
if ! isort --check-only "$STAGED_PYTHON_FILES" &>$ISORT_OUTPUT; then
isort "$STAGED_PYTHON_FILES" &>$ISORT_OUTPUT
isort $STAGED_PYTHON_FILES &>$ISORT_OUTPUT
printf "Reformatted.\n"
formatter_updated=1
else
@ -71,7 +71,7 @@ if type flake8 &>/dev/null; then
FLAKE8_OUTPUT="/tmp/gc-flake8-output.log"
touch $FLAKE8_OUTPUT
if ! flake8 "$STAGED_PYTHON_FILES" &>$FLAKE8_OUTPUT; then
if ! flake8 $STAGED_PYTHON_FILES &>$FLAKE8_OUTPUT; then
printf "FAIL\n"
cat $FLAKE8_OUTPUT
checker_dirty=1