Great developers write great code that is not only great, but also follows the coding standards of the framework/language they use. We are great developers!
Today I'm challenging you that from now on, you only push code that follows Drupal's coding standards. But instead of asking you to learn and remember all those boring rules, I suggest you a great tool. PHP_CodeSniffer for the rescue! It is a PHP script that detects violations of a defined coding standard in your code. Coder module for Drupal is kind enough to define those standards for us.
Setting it up is really simple. There are many ways to install and use PHP_CodeSniffer. I'm going to share my favorite approach, which, I believe, is the most simple and straightforward way.
-
Install Composer:
$ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer`