Skip to content

Instantly share code, notes, and snippets.

@mitalcoi
Last active May 2, 2017 18:49
Show Gist options
  • Save mitalcoi/407437aa57b6b4ae84f0131e023e8d64 to your computer and use it in GitHub Desktop.
Save mitalcoi/407437aa57b6b4ae84f0131e023e8d64 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="php-cs-fixer"
git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | while read line; do
$PHP_CS_FIXER fix --verbose "$line";
git add "$line";
done
echo "php-cs-fixer pre commit hook finish"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment