Check (and fix) your code against Drupal's code conventions and coding standard.
MIT License
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
Manually add to your composer.json
file:
"extra": {
"grumphp": {
"config-default-path": "vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml"
}
}
"extra": {
"grumphp": {
"config-default-path": "vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml"
}
}
Edit the file grumphp.yml.dist
or grumphp.yml
and add on the top it:
imports:
- { resource: vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml }
imports:
- { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }
To add an extra Grumphp task:
imports:
- { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }
parameters:
extra_tasks:
phpunit:
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 :-)