File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed
Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 11# path to binaries
22PHPCS_BIN=/usr/local/bin/phpcs
3- PHPCSFIXER_BIN=/Users/davimarcondes/.composer/vendor/bin/php-cs-fixer
43PHPMD_BIN=/usr/local/bin/phpmd
54
65# the coding standard, you can also specify a path to your own standard here
Original file line number Diff line number Diff line change 55#
66# This hook performs the following validation:
77# - PHP CodeSniffer
8- # - PHP-CS Fixer (only in --dry-run mode)
98# - PHP Mess Detector
109#
1110# Based on https://gist.github.com/codemis/8225337
1514# #########
1615
1716PHPCS_BIN=/usr/bin/phpcs
18- PHPCSFIXER_BIN=/usr/bin/php-cs-fixer
1917PHPMD_BIN=/usr/bin/phpmd
2018PHPCS_CODING_STANDARD=PEAR
2119PHPCS_IGNORE=
@@ -121,18 +119,10 @@ PHPCS_RETVAL=$?
121119
122120if [ $PHPCS_RETVAL -ne 0 ]; then
123121 echo " $PHPCS_OUTPUT " | less
124- else
125- echo " :: Inspection is OK! :: "
126- fi
127122
128- echo " "
129- echo " :: PHP CS Fixer inspection :: "
130- echo " "
131- PHPCSFIXER_OUTPUT=$( $PHPCSFIXER_BIN fix $STAGED_FILES --level=psr2 --dry-run --diff)
132- PHPCSFIXER_RETVAL=$?
123+ rm -rf $TMP_STAGING
133124
134- if [ $PHPCSFIXER_RETVAL -ne 0 ]; then
135- echo " $PHPCSFIXER_OUTPUT " | less
125+ exit $PHPCS_RETVAL
136126else
137127 echo " :: Inspection is OK! :: "
138128fi
@@ -145,12 +135,12 @@ PHPMD_RETVAL=$?
145135
146136if [ $PHPMD_RETVAL -ne 0 ]; then
147137 echo " $PHPMD_OUTPUT " | less
138+
139+ rm -rf $TMP_STAGING
140+
141+ exit $PHPMD_RETVAL
148142else
149143 echo " :: Inspection is OK! :: "
150144fi
151145
152-
153- # delete temporary copy of staging area
154- rm -rf $TMP_STAGING
155-
156- exit $PHPCS_RETVAL
146+ exit 0;
You can’t perform that action at this time.
0 commit comments