1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +02:00

[FEATURE] Update GIT hook

This commit is contained in:
René Bigler 2015-11-19 22:55:37 +01:00
parent 69a4a5f1f4
commit 61de51ef93

View file

@ -20,7 +20,7 @@ else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi 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 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]}) PARSEROUT=$(php --syntax-check "$file" 2>&1 | egrep -v 'No syntax errors|Errors parsing'; exit ${PIPESTATUS[0]})
PARSERST=$? PARSERST=$?
echo -e -n "\r${file}..." echo -e -n "\r${file} ... "
if [ $FIXERST != 0 ]; then if [ $FIXERST != 0 ]; then
echo $FIXEROUT echo $FIXEROUT
elif [ $PARSERST != 0 ]; then elif [ $PARSERST != 0 ]; then
@ -45,4 +45,8 @@ for file in $(git diff-index --name-only $against); do
ST=$(($ST | $FIXERST | $PARSERST)) ST=$(($ST | $FIXERST | $PARSERST))
done done
if [ $ST != 0 ]; then
echo "Use 'php-cs-fixer fix -v --fixers=$FIXERS <file>' to correct"
fi
exit $ST exit $ST