nickwilde1990 / drupal-standards-composer-commands
Provides composer commands for standards checks on your Drupal project
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:composer-plugin
Requires
- composer-plugin-api: ^1.1
- dealerdirect/phpcodesniffer-composer-installer: ^0.4.4
- drupal/coder: ^8.2.12
- mouf/nodejs-installer: ^1.0
- squizlabs/php_codesniffer: 2.9.x-dev
This package is auto-updated.
Last update: 2024-11-27 18:22:04 UTC
README
Table Of Contents
Introduction
Provides composer commands to check your project according to Drupal Standards.
Sets up all the requirements for basic standards checks. If you have them, this
will use phpcs.xml
and similar depending on the specific tool if available to
use your customized standards or will use Drupal 8 defaults.
Installation
Install through Composer. Due to the status of some of
the dependencies, you will need to have "minimum-stability": "dev"
in your
composer config. When using that, in most cases, it is recommended to also use
"prefer-stable": true
.
composer require --dev nickwilde1990/drupal-standards-composer-commands
Usage
Run
composer commandname/alias
Note: Unless/Until this pull request
lands in composer, you will
need to run any command provided by this in your project root (same location as
your composer.json
).
Available Commands
-
drupal-eslint
[cs-js-scan
]: Runs Eslint on your code (check JS standards). Will use default Drupal 8 standards if you do not have a.eslintrc.json
. -
drupal-eslint-fix
[cs-js-fix
]: Runs Eslint fix mode on your code (automatically fix JS standards compliance issues). Will use default Drupal 8 standards if you do not have a.eslintrc.json
. -
drupal-phpcs
[cs-php-scan
]: Runs PHPCS on your code (check PHP standards). Will use standard Drupal 8 mode if you do not have aphpcs.xml
orphpcs.xml.dist
. -
drupal-phpcbf
[cs-php-fix
]: Runs PHPCBF on your code (automatically fix many PHP standards complaince issues). Will use standard Drupal 8 mode if you do not have aphpcs.xml
orphpcs.xml.dist
. -
drupal-stylelint
[cs-css-scan
]: Runs Stylelint on your code (check CSS standards). Will use default Drupal 8 standards if you do not have a.stylelintrc.json
. -
drupal-stylelint-fix
[cs-css-fix
]: Runs Stylelint fix mode on your code (automatically fix CSS standards compliance issues). Will use default Drupal 8 standards if you do not have a.stylelintrc.json
.
Configuration
Some custom configuration can be provided in your package's composer.json
in
the extra
key under drupal-standards-commands
. Specifically:
ignore-paths
: Provide an array of extra paths for tools to ignore (affects all scan/fix tools). Default:["core"]
Example:{ "extra": { "drupal-standards-commands": { "ignore-paths": [ "core", "tests" ] } } }
Known issues
See open bug reports in the issue queue
Contribution
Contributions are welcome!
License
Copyright (C) 2018 Nick Wilde.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/