Skip to content

Instantly share code, notes, and snippets.

@kevincolten
Created January 27, 2015 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevincolten/6bc2ab9a96017567b993 to your computer and use it in GitHub Desktop.
Save kevincolten/6bc2ab9a96017567b993 to your computer and use it in GitHub Desktop.
Run PHP_CodeSniffer on files with uncommitted changes
if [ "$(git diff --name-only master --diff-filter=AMR | grep -Ei "^.*app\/(models|controllers)\/.*\.php$")" ]; then vendor/bin/phpcs $(git diff --name-only master --diff-filter=AMR | grep -Ei "^.*app\/(models|controllers)\/.*\.php$") --standard=PSR2; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment