Skip to content
Check (and fix) your code against Drupal's code conventions and coding standard.
Branch: master
Clone or download
Latest commit 9dd3353 Aug 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Issue #6: Remove the custom ComposerNormalize service now that it has… Aug 15, 2019
src Rely on drupol/phpcsfixer-configs-drupal from now on. Jul 22, 2019
LICENSE Rely on drupol/phpcsfixer-configs-drupal from now on. Jul 22, 2019
composer.json Update composer.json and relax the symfony/yaml package version. Aug 10, 2019

Latest Stable Version Stars Total Downloads Build Status License Say Thanks! Donate!

Drupal conventions

This tool will check your code against Drupal's coding standard.

It's based on GrumPHP and comes with a default configuration tailored for Drupal development.

The following checks are triggered:

Drupal 7 and 8 are supported.


composer require --dev drupol/drupal-conventions

If you're not using GrumPHP

Manually add to your composer.json file:

Drupal 8

    "extra": {
        "grumphp": {
            "config-default-path": "vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml"

Drupal 7

    "extra": {
        "grumphp": {
            "config-default-path": "vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml"

If you're using GrumPHP already

Edit the file grumphp.yml.dist or grumphp.yml and add on the top it:

Drupal 8

  - { resource: vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml }

Drupal 7

  - { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }

To add an extra Grumphp task:

  - { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }

      always_execute: false

In conjunction with extra_tasks, use skip_tasks to skip tasks if needed.


Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)

You can’t perform that action at this time.