diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit index 34f907af..385faac0 100755 --- a/scripts/hooks/pre-commit +++ b/scripts/hooks/pre-commit @@ -20,7 +20,7 @@ else against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi -FIXERS='indentation,linefeed,trailing_spaces,short_tag,braces,controls_spaces,eof_ending,visibility' +FIXERS='indentation,linefeed,trailing_spaces,short_tag,braces,controls_spaces,eof_ending,visibility,align_equals,concat_with_spaces,elseif,line_after_namespace,lowercase_constants,lowercase_keywords' ST=0 # Global exit status @@ -34,7 +34,7 @@ for file in $(git diff-index --name-only $against); do PARSEROUT=$(php --syntax-check "$file" 2>&1 | egrep -v 'No syntax errors|Errors parsing'; exit ${PIPESTATUS[0]}) PARSERST=$? - echo -e -n "\r${file}..." + echo -e -n "\r${file} ... " if [ $FIXERST != 0 ]; then echo $FIXEROUT elif [ $PARSERST != 0 ]; then @@ -45,4 +45,8 @@ for file in $(git diff-index --name-only $against); do ST=$(($ST | $FIXERST | $PARSERST)) done +if [ $ST != 0 ]; then + echo "Use 'php-cs-fixer fix -v --fixers=$FIXERS ' to correct" +fi + exit $ST