coderkakarrot/drupal-code-scanner

Setups code quality checking tools for Drupal project.

Installs: 5 003

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

pkg:composer/coderkakarrot/drupal-code-scanner

1.0.0 2020-08-31 20:16 UTC

This package is auto-updated.

Last update: 2025-09-22 20:06:04 UTC


README

Overview

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

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

Install

  1. Add coderkakarrot/drupal-code-scanner to composer.json (like here) or just composer require --dev coderkakarrot/drupal-code-scanner
  2. Replace grumphp.yml in project's root directory (not Drupal root directory) with vendor/coderkakarrot/drupal-code-scanner/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. PHP Lint
  3. YAML Lint
  4. Composer
  5. Composer Normalize
  6. JSONLint
  7. PHP Copy/Paste Detector (CPD)

Long list of additional checks/validators available here.