File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 1313#
1414# #########
1515
16+ GRAY=' \033[0;37m'
17+ RED=' \033[0;31m'
18+ GREEN=' \033[0;32m'
19+
1620PHPCS_BIN=/usr/bin/phpcs
1721PHPMD_BIN=/usr/bin/phpmd
1822PHPCS_CODING_STANDARD=PEAR
114118done
115119
116120echo " "
117- echo " :: PHP CodeSniffer inspection :: "
121+ tput setaf 7 ; echo " :: PHP CodeSniffer inspection :: "
118122PHPCS_OUTPUT=$( $PHPCS_BIN -s $IGNORE_WARNINGS --standard=$PHPCS_CODING_STANDARD $ENCODING $IGNORE $STAGED_FILES )
119123PHPCS_RETVAL=$?
120124
121125if [ $PHPCS_RETVAL -ne 0 ]; then
122- echo " Issues found: "
126+ tput setaf 1; echo " -> Issues found: "
127+ tput setaf 7;
123128 echo " $PHPCS_OUTPUT "
124129
125130 rm -rf $TMP_STAGING
126131
127132 exit $PHPCS_RETVAL
128133else
129- echo " -> Inspection is OK!"
134+ tput setaf 2 ; echo " -> Inspection is OK!"
130135fi
131136
132137echo " "
133- echo " :: PHP Mess Detector inspection :: "
134- echo " "
138+ tput setaf 7; echo " :: PHP Mess Detector inspection :: "
135139PHPMD_OUTPUT=$( $PHPMD_BIN $STAGED_FILES $PHPMD_OUTPUT_MODE $PHPMD_PATTERNS )
136140PHPMD_RETVAL=$?
137141
138142if [ $PHPMD_RETVAL -ne 0 ]; then
139- echo " Issues found: "
140- echo " $PHPMD_OUTPUT "
143+ tput setaf 1 ; echo " -> Issues found: "
144+ tput setaf 7 ; echo " $PHPMD_OUTPUT "
141145
142146 rm -rf $TMP_STAGING
143147
144148 exit $PHPMD_RETVAL
145149else
146- echo " -> Inspection is OK!"
150+ tput setaf 2 ; echo " -> Inspection is OK!"
147151fi
148152
149153exit 0;
You can’t perform that action at this time.
0 commit comments