Last active
August 29, 2015 14:03
-
-
Save bayleedev/02f7a3291bd99779c486 to your computer and use it in GitHub Desktop.
Report PHP CodeSniffer errors and warnings to graphite.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRAPHITE_PORT=2003 | |
GRAPHITE_SERVER="127.0.0.1" | |
ERROR_PATH="project.codesniff.errors" | |
WARNING_PATH="project.codesniff.warnings" | |
APP_PATH="/var/www/apps/project/app" | |
APP_STANDARD="PEAR" | |
SETUP="cd ${APP_PATH} && git fetch origin > /dev/null 2>&1 && git reset --hard origin/dev > /dev/null 2>&1 && php composer.phar install > /dev/null 2>&1" | |
RESPONSE=`${SETUP} && ./bin/phpcs --standard=${APP_STANDARD} --report=summary ./ | grep TOTAL | awk -v ERROR_PATH=${ERROR_PATH} -v WARNING_PATH=${WARNING_PATH} '{ print ERROR_PATH,$4, strftime("%s") "\\\\n" WARNING_PATH, $7,strftime("%s") }'` | |
echo -e $RESPONSE | nc ${GRAPHITE_SERVER} ${GRAPHITE_PORT}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment