Hi guys,
Mark did an amazing job in put all CakePHP core in the Cake Code Standard. He also changed the continuous integration (
http://ci,
cakephp.org) to fail the build if the phpcs fail.
To catch these errors before CI, I created a git pre-commit hook to fail the commit if your changes are breaking the standards:
https://gist.github.com/2268925
It will check only the modified files, so it does not take long time. To install, just create a file .git/hooks/pre-commit with the gist content and save the file with executable permission (chmod +x .git/hooks/pre-commit).
It can be used for everybody that contribute to the core or if someone wants to keep the app using the same code standard.
If, for some reason (ie, you are commiting to release 1.3), you want to commit ignoring the rules, you can use the -n param in git commit, ie: git commit -n -m "My message"
Juan Basso