From 32d456f593fc2387bf81f8fe63e9471f1e65de73 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 24 Aug 2021 02:27:27 +0200 Subject: [PATCH] [TASK] Move the Composer script descriptions to the `composer.json` (#284) Composer has a built-in functionality for describing Composer scripts, and we should use it for documentating our custom scripts. --- README.md | 24 ++---------------------- composer.json | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index cb8d09c..1f0fe72 100644 --- a/README.md +++ b/README.md @@ -125,28 +125,8 @@ before you can use the Composer scripts. ### Available Composer scripts You can run `composer` (or `ddev composer`) to display a list of all available -Composer commands and scripts. - -| Script name | Action | Tool | -|------------------------|-------------------------------|---------------------------------------------------------------------------------| -|`ci` | run code checks | the tools listed for the individual checks | -|`ci:composer:normalize` | normalize `composer.json` | [composer-normalize](https://github.com/ergebnis/composer-normalize) | -|`ci:json:lint` | lint the JSON files | [JSON Lint](https://github.com/Seldaek/jsonlint) | -|`ci:php` | run all static checks for PHP | the tools listed for the individual checks | -|`ci:php:copypaste` | check for copy'n'pasted code | [PHP Copy/Paste Detector (PHPCPD)](https://github.com/sebastianbergmann/phpcpd) | -|`ci:php:cs-fixer` | check the code style | [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) | -|`ci:php:lint` | lint the PHP files | `php -l` | -|`ci:php:sniff` | check the code style | [PHP_CodeSniffer (PHPCS)](https://github.com/squizlabs/PHP_CodeSniffer) | -|`ci:php:stan` | check the types | [PHPStan](https://github.com/phpstan/phpstan) | -|`ci:tests:functional` | run the functional tests | [PHPUnit](https://github.com/sebastianbergmann/phpunit/) | -|`ci:tests:tests` | run all PHPUnit tests | [PHPUnit](https://github.com/sebastianbergmann/phpunit/) | -|`ci:tests:unit` | run the unit tests | [PHPUnit](https://github.com/sebastianbergmann/phpunit/) | -|`ci:ts:lint` | lint the TypoScript files | [TypoScript Lint](https://github.com/martin-helmich/typo3-typoscript-lint) | -|`ci:yaml:lint` | lint the YAML files | [yaml-lint](https://github.com/j13k/yaml-lint) | -|`docs:generate` | render documentation | [dockrun_t3rd](https://github.com/t3docs/docker-render-documentation#readme) | -|`fix:php` | run all fixes for PHP | the tools listed for the individual checks | -|`fix:php:cs` | fix the code style | [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) | -|`fix:php:sniff` | fix the code style | [PHP_CodeSniffer (PHPCS)](https://github.com/squizlabs/PHP_CodeSniffer) | +Composer commands and scripts. (For all custom Composer scripts, are descriptions +in the `composer.json` in the `script-description` section.) ## Running the unit and functional tests diff --git a/composer.json b/composer.json index 390e91f..ec26e9b 100644 --- a/composer.json +++ b/composer.json @@ -145,6 +145,28 @@ "rm phpcs.xml" ] }, + "scripts-descriptions": { + "ci": "Runs all dynamic and static code checks.", + "ci:composer:normalize": "Checks the composer.json.", + "ci:dynamic": "Runs all PHPUnit tests (unit and functional).", + "ci:json:lint": "Lints the JSON files.", + "ci:php": "Runs all static checks for the PHP files.", + "ci:php:copypaste": "Checks for copy'n'pasted PHP code.", + "ci:php:cs-fixer": "Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer).", + "ci:php:lint": "Lints the PHP files for syntax errors.", + "ci:php:sniff": "Checks the code style with PHP_CodeSniffer (PHPCS).", + "ci:php:stan": "Checks the PHP types using PHPStan.", + "ci:static": "Runs all static code checks (syntax, style, types).", + "ci:tests": "Runs all PHPUnit tests (unit and functional).", + "ci:tests:functional": "Runs the functional tests.", + "ci:tests:unit": "Runs the unit tests.", + "ci:ts:lint": "Lints the TypoScript files.", + "ci:yaml:lint": "Lints the YAML files.", + "docs:generate": "Renders the extension ReST documentation.", + "fix:php": "Runs all fixers for the PHP code.", + "fix:php:cs": "Fixes the code style with PHP-CS-Fixer.", + "fix:php:sniff": "Fixes the code style with PHP_CodeSniffer." + }, "support": { "issues": "https://github.com/TYPO3-Documentation/tea/issues", "source": "https://github.com/TYPO3-Documentation/tea"