miteshmap/drupal-quality-checker

为Drupal项目设置代码质量检查工具。

1.0.3 2023-05-17 22:09 UTC

This package is auto-updated.

Last update: 2024-09-18 00:51:08 UTC


README

概览

提供了一套库,可以轻松地基于 GrumPHP 为Drupal模块/主题/配置文件设置代码质量检查。查看这个 Lullabot 文章 以获取更多详细信息。

注意: 此库旨在帮助托管在个人git仓库中的贡献/自定义Drupal模块/主题/配置文件。

安装

  1. 将以下代码添加到 composer.jsonextra.drupal-scaffold.allowed-packages 部分。
     "extra": {
         "drupal-scaffold": {
             "allowed-packages": [
                 "miteshmap/drupal-quality-checker"
             ],
         }
     }
    
  2. composer require "miteshmap/drupal-quality-checker:^1.0"
  3. grumphp.yml.dist 复制到项目根目录(不是Drupal根目录)中,名为 ./grumphp.yml

这样就完成了。现在,所有任务(如下所示)将在每次 git commit 时运行。

注意: 作为安装的一部分,GrumPHP 将添加 pre-commit 钩子到仓库中。现有的 pre-commit 可能会在安装/卸载时被 销毁

功能

  1. PHPCS 与 Drupal 标准一致。
  2. PHP Lint
  3. YAML Lint
  4. Composer
  5. Composer Normalize
  6. JSONLint
  7. PHP Copy/Paste Detector (CPD)

更多检查/验证器可用,请参阅 此处