Skip to content

Instantly share code, notes, and snippets.

@dborsatto
Last active March 8, 2019 13:56
Show Gist options
  • Save dborsatto/1c2de53a91064bf224b06f01583ab25b to your computer and use it in GitHub Desktop.
Save dborsatto/1c2de53a91064bf224b06f01583ab25b to your computer and use it in GitHub Desktop.
Execute php-cs-fixer as a Git pre-commit hook
git diff --name-only --cached --diff-filter=ACMRTUXB | while read filename; do
php-cs-fixer fix $filename
git add $filename
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment