nickwilde1990/drupal-standards-composer-commands

为您的 Drupal 项目提供标准检查的 Composer 命令

1.0.0-beta3 2018-09-19 22:32 UTC

This package is auto-updated.

Last update: 2024-08-27 17:46:14 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

目录

简介

提供根据 Drupal 标准检查项目的 Composer 命令。设置所有基本标准检查的要求。如果已安装,则将使用 phpcs.xml 和类似工具的特定工具,以使用您自定义的标准,或者将使用 Drupal 8 默认设置。

安装

通过 Composer 安装。由于某些依赖项的状态,您需要在您的 composer 配置中设置 "minimum-stability": "dev"。在大多数情况下,建议同时使用 "prefer-stable": true

composer require --dev nickwilde1990/drupal-standards-composer-commands

用法

运行

composer commandname/alias

注意:除非/直到 这个请求 被整合到 composer 中,否则您需要在项目根目录(与您的 composer.json 相同的位置)中运行此提供的任何命令。

可用命令

  • drupal-eslint [cs-js-scan]: 在您的代码上运行 Eslint(检查 JS 标准)。如果没有 .eslintrc.json,则将使用默认的 Drupal 8 标准。

  • drupal-eslint-fix [cs-js-fix]: 在您的代码上运行 Eslint 修复模式(自动修复 JS 标准合规性问题)。如果没有 .eslintrc.json,则将使用默认的 Drupal 8 标准。

  • drupal-phpcs [cs-php-scan]: 在您的代码上运行 PHPCS(检查 PHP 标准)。如果没有 phpcs.xmlphpcs.xml.dist,则将使用标准 Drupal 8 模式。

  • drupal-phpcbf [cs-php-fix]: 在您的代码上运行 PHPCBF(自动修复许多 PHP 标准合规性问题)。如果没有 phpcs.xmlphpcs.xml.dist,则将使用标准 Drupal 8 模式。

  • drupal-stylelint [cs-css-scan]: 在您的代码上运行 Stylelint(检查 CSS 标准)。如果没有 .stylelintrc.json,则将使用默认的 Drupal 8 标准。

  • drupal-stylelint-fix [cs-css-fix]: 在您的代码上运行 Stylelint 修复模式(自动修复 CSS 标准合规性问题)。如果没有 .stylelintrc.json,则将使用默认的 Drupal 8 标准。

配置

一些自定义配置可以提供在您的包的 composer.json 中的 extra 键下的 drupal-standards-commands。具体来说

  • ignore-paths: 为工具提供要忽略的额外路径数组(影响所有扫描/修复工具)。默认:["core"] 示例
    {
      "extra": {
        "drupal-standards-commands": {
          "ignore-paths": [
            "core",
            "tests"
          ]
        }
      }
    }

已知问题

问题队列 中查看开放的错误报告

贡献

欢迎贡献!

许可证

版权(C)2018 Nick Wilde。

本程序是免费软件:您可以按照自由软件基金会发布的 GNU 通用公共许可证的条款重新分发和/或修改它,许可证版本 3 或(根据您的选择)任何较新版本。

本程序以希望它是有用的目的进行分发,但没有任何保证;甚至没有关于其商业性或适用于特定目的的暗示性保证。有关详细信息,请参阅GNU通用公共许可证。

您应该已收到与此程序一起的GNU通用公共许可证副本。如果没有,请参阅https://gnu.ac.cn/licenses/