Last active
September 25, 2019 10:44
-
-
Save supercid/4a85f15f9f7ff5b87b232d753cb10876 to your computer and use it in GitHub Desktop.
Run m2 checks before commit
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
#!/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