Skip to content

Instantly share code, notes, and snippets.

@mertvetsky
Created July 17, 2019 16:46
Show Gist options
  • Save mertvetsky/ce9a8dd0cb9b86bef0a59c344216be27 to your computer and use it in GitHub Desktop.
Save mertvetsky/ce9a8dd0cb9b86bef0a59c344216be27 to your computer and use it in GitHub Desktop.
php_lint.bash
#!/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