Skip to content

Instantly share code, notes, and snippets.

@SergeAx
Last active September 4, 2017 17:41
Show Gist options
  • Save SergeAx/63c836c0eb39a99f700d4031a8f50d73 to your computer and use it in GitHub Desktop.
Save SergeAx/63c836c0eb39a99f700d4031a8f50d73 to your computer and use it in GitHub Desktop.
Put this file into path directory and use as "git phpcs" (Works in Windows, put script to C:\Program Files\Git\cmd\)
#!/bin/sh
ROOT=$(git rev-parse --show-toplevel);
FILES=$(git diff HEAD --name-only);
if [ ! -z "$FILES" ]; then
for FILE in $FILES; do
phpcs $ROOT/$FILE
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment