Skip to content

Instantly share code, notes, and snippets.

@supercid
Last active Sep 25, 2019
Embed
What would you like to do?
Run m2 checks before commit
#!/bin/sh
export PATH=/usr/local/bin:$PATH
ROOT=`git rev-parse --show-toplevel`
if [ ! -d "$ROOT/vendor" ]; then
echo "Run composer install to run checkstyles"
exit 1
fi
## Code sniffer
$ROOT/vendor/bin/phpcs --standard=ruleset.xml || exit 1
## PHPMD
$ROOT/vendor/bin/phpmd . xml codesize,naming,unusedcode,controversial,design --exclude vendor,var,build,tests || exit 1
## PHAN
$ROOT/vendor/bin/phan --config-file=phan.php || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment