Skip to content

Instantly share code, notes, and snippets.

@arest
Last active November 20, 2017 16:43
Show Gist options
  • Select an option

  • Save arest/9c01738aed02b2a57f03d67ad554cd3e to your computer and use it in GitHub Desktop.

Select an option

Save arest/9c01738aed02b2a57f03d67ad554cd3e to your computer and use it in GitHub Desktop.
Git pre push hook - Check PSR2 compliance
#!/bin/bash
printf "Checking PSR2 before pushing\n"
vendor/bin/phpcs --standard=PSR2 src/AppBundle/ tests/
OUT=$?
if [ $OUT -eq 0 ];then
printf "OK! Pushing...\n"
exit 0
else
printf "Errors found! Not pushing...\n"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment