qntn/drupal-quality-checker

Setups code quality checking tools for Drupal project.

9.2.1 2021-01-26 14:51 UTC

This package is auto-updated.

Last update: 2024-03-26 21:03:41 UTC


README

Overview

Provides set of libraries to easily setup code quality checks based on GrumPHP for Drupal module/theme/profile. Check out this article from Lullabot for more details.

>Note: This library is aimed to help contributed/custom Drupal module/theme/profile hosted in individual git repository.

Install

  1. Add vijaycs85/drupal-quality-checker to composer.json (like here) or just composer require --dev vijaycs85/drupal-quality-checker
  2. Replace grumphp.yml in project's root directory (not Drupal root directory) with vendor/vijaycs85/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. Existing pre-commit might get destroyed when install/uninstall.

Features

  1. PHPCS with Drupal standard.
  2. PHPLint
  3. YAML Lint
  4. Composer
  5. Composer Normalize
  6. JSONLint
  7. PHP Copy/Paste Detector (CPD)
  8. drupal-check

Long list of additional checks/validators available here.

Sample

Pass

drupal-quality-checker-pass

Fail

drupal-quality-checker-fail

Demo

Implemented in Modal Configuration module.