8e9533cd873f0692c5c5909240ed1d94a56c03ec
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Build / Scripts / cglFixMyCommit.sh
1 #!/bin/bash
2
3 #########################
4 #
5 # CGL check latest core commit.
6 #
7 # It expects to be run from the core root.
8 #
9 # To auto-fix single files, use the php-cs-fixer command directly
10 # substitute $FILE with a filename
11 #
12 ##########################
13
14 COUNTER=0
15
16 for FILE in $(git diff-tree --no-commit-id --name-only -r HEAD | grep '.php$'); do
17 if [ -e $FILE ]
18 then
19 ./bin/php-cs-fixer fix $FILE \
20 -v \
21 --config=Build/.php_cs
22 if [ "$?" = "1" ]
23 then
24 COUNTER=$((COUNTER+1))
25 fi
26 fi
27 done
28
29 if [ ${COUNTER} -gt 0 ] ; then
30 echo "$COUNTER number of files are not CGL clean. Check $0 to find out what is going wrong."
31 exit 1
32 fi
33
34 exit 0