Provides set of libraries to easily setup code quality checks based on GrumPHP for Drupal module/theme/profile.
Note: This library is aimed to help ecedi starterkit and distribution.
- Add
judapriest/drupal-quality-checker
tocomposer.json
:composer require --dev judapriest/drupal-quality-checker
- Replace
grumphp.yml
in your project's root directory (not Drupal root directory) withvendor/judapriest/drupal-quality-checker/grumphp.yml.dist
That's it. Now, all tasks (listed below) run on every git commit
.
Note: As part of install, GrumPHP adds
pre-commit
hook to repository. Existingpre-commit
might get destroyed when install/uninstall.
- PHPCS with Drupal standard.
- PHPLint
- YAML Lint
- Composer
- JSONLint
- PHP Copy/Paste Detector (CPD)
- Composer Normalizer
Long list of additional checks/validators available here.
When installed (see #install), it's configure to run on every git commit
. It will only analyse files you are commiting.
You can also use bin/grumphp run
from the root directory to analyse all existing file (minus the exclude or ignore files define in the grumphp.yml file).
Implemented in Modal Configuration module.
- You can remove the package with
composer remove judapriest/drupal-quality-checker --update-with-dependencies
. - Remove the
grumphp.yml
in project's root directory if it's there. - Modify the .git/hooks/pre-commit and .git/hooks/commit-msg if necessary