Created
July 17, 2019 16:46
-
-
Save mertvetsky/ce9a8dd0cb9b86bef0a59c344216be27 to your computer and use it in GitHub Desktop.
php_lint.bash
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
#!/usr/bin/env bash | |
for i in `git diff --name-only master | egrep '\.php$'` ; do | |
[ ! -e $i ] && continue | |
msg=`php -l $i 2>1` | |
if echo "$msg" | egrep -v '^No syntax' > /dev/null; then | |
echo $msg; | |
exit 255 | |
fi | |
done | |
echo OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment