Created
October 10, 2017 12:38
-
-
Save hayzem/c277b135b0f850a282eb9c9dc143c7f3 to your computer and use it in GitHub Desktop.
Bash script for PHP CS Fix with git pre-commit hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git status|grep -E "(.php)"| cut -d':' -f 2| while read -r line ; do | |
echo "php cs fix: $line" | |
/usr/local/bin/php /usr/local/bin/php-cs-fixer fix ${line} --rules=@Symfony | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment