News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kevin van Zonneveld:
It's Almost 2014 and We Are Still Committing Broken Code
December 30, 2013 @ 09:19:28

Kevin van Zonneveld has a new post that, while not PHP specific, does have a handy script that will help you stop committing broken code.

Whatever the reason, it's almost 2014 and we are still committing broken code. This needs to stop because best case: Travis or Jenkins prevent those errors from hitting production and it's frustrating to go back and revert/redo that stuff. A waste of your time and state of mind, you were already working on other things. Worst case: your error goes unnoticed and hits production.

To help resolve the problem, he suggests using the "hook" system common to most version control software. In his specific example, he shows the use of a pre-commit hook that fires off a bash script on the files being committed. He includes the full code for this bash script that includes a check for PHP scripts using the built in PHP linter (the "-l" option on the command line). He also includes the commands and updates you'll need to make to get it installed on git.

0 comments voice your opinion now!
git precommit hook syntax error bash script tutorial

Link: http://kvz.io/blog/2013/12/29/one-git-commit-hook-to-rule-them-all/

blog comments powered by Disqus

Similar Posts

Daniel Cousineau's Blog: Zend Framework Module Init Script (Controller Plugin)

SitePoint PHP Blog: Integrating Polymer/Dart and Symfony Part 1

DevShed: Overloading Classes in PHP 5

Phil Sturgeon: Package Watch: Image Management

WeberDev.com: PHP 101 (part 11) - Sinfully Simple (SimpleXML)


Community Events





Don't see your event here?
Let us know!


community configure series unittest language podcast wordpress interview threedevsandamaybe api laravel release install symfony library introduction application code list developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework