Created
August 28, 2015 08:45
-
-
Save lillesvin/2f94f433f8e35721ab2e to your computer and use it in GitHub Desktop.
Creates a git command 'lint-php' (if this script exists in your PATH and is executable) that syntax checks all modified/added files that end in ".php".
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/bash | |
files=$(git status --porcelain | sed -e 's/^.* //' | grep -P '\.php$') | |
for f in $files; do | |
php -l $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment