Skip to content

Instantly share code, notes, and snippets.

@dbtlr
Created October 31, 2013 15:02
Show Gist options
  • Save dbtlr/7251217 to your computer and use it in GitHub Desktop.
Save dbtlr/7251217 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Take all the changes and run them through PHP Lint. Let the commit fail if this fails.
git diff --cached --name-status | awk '{ if ($1 != "D") print $2}' | grep -e \.php$ | xargs -n1 php -l
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment