Skip to main content

joeri poesen / bio / blog / contact

Home / Tags / coding

PHP/Drupal Code Quality Quick Wins, Part 3: Automated Validation with Git pre-commit Hooks

Even within small, closely-knit teams introducing new ways of doing things can take its time being adopted across the board. This is where having a Git-based workflow pays off: by adding a pre-commit hook in your local repository you can automatically have Git run php -l and phpcs on the files affected by your commit. If the linting or code validation check fails, the commit will be aborted.

PHP/Drupal Code Quality Quick Wins, Part 2: Validating Code Standards

The Drupal project has coding standards, available at https://drupal.org/coding-standards, based on the PEAR coding standards (http://pear.php.net/manual/en/standards.php).

PHP/Drupal Code Quality Quick Wins, Part 1: Linting

In this first part we’re looking at a few tools that are very easy to set up and use, yet can make a dramatic impact in the quality and coherence of your team’s codebase.

From validating syntax to detecting dead code to graphing dependency chains and measuring cyclometric complexity, static analysis tools help you analyse code without actually executing it.

Subscribe to RSS - coding