Skip to content

Instantly share code, notes, and snippets.

@wowo
Last active August 29, 2015 14:24
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wowo/e8ff09a0f12d4d2b96f9 to your computer and use it in GitHub Desktop.
Save wowo/e8ff09a0f12d4d2b96f9 to your computer and use it in GitHub Desktop.
Basic pre-commit git hook
#!/bin/bash
exec < /dev/tty
phpunit
rc=$?
if [[ $rc != 0 ]] ; then
echo -n "It looks like some of your tests failed. "
exit $rc;
fi
phpcs -n --standard=PSR2 module/
rc=$?
if [[ $rc != 0 ]] ; then
echo -n "It looks like you made some code style violations "
exit $rc;
fi
exit $rc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment