Coder
By douggreen on , updated
Coder checks your Drupal code against coding standards and other best practices. It can also fix coding standard violations for you with the phpcbf command from PHP_CodeSniffer, see the installation instructions and usage examples. Those checks apply to all versions of Drupal, so you can use Coder 8.3.x to check Drupal 7 code.
Coder is not a module, it is used as command line tool and in IDEs.
Note that Javascript support has been removed. To check and fix Javascript files please use ESLint and see the Drupal ESLint documentation.
Online version
Usage
$ phpcs --standard=Drupal example.module
FILE: /home/klausi/workspace/coder/example.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
1 | ERROR | [ ] Missing file doc comment
3 | ERROR | [ ] Missing function doc comment
4 | ERROR | [ ] Opening brace should be on the same line as the declaration
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Drupal 8 module upgrading
See https://drupal.org/project/drupalmoduleupgrader
Contributing
1. Make sure an issue exists in the issue queue
2. Create a Pull Request against https://github.com/pfrenssen/coder
3. Post a link to the pull request to the issue on drupal.org and set the issue to "needs review"
Old Coder module for D7 and D6
Only the current 8.x-3.x version is supported, and works on Drupal 7 as well as Drupal 8. The older versions are deprecated and unsupported. All information about these legacy versions are now on a documentation page.
Supporting organizations:
sponsoring work hours for maintenance
Originally developed by douggreen and partially supported by CivicActions
Sponsored the Coder Review module for several years of work.
Project information
Downloads
8.3.13
released 17 April 2021
✓ Recommended by the project’s maintainer.