From 059c1bb90544e28048f5b02f19dc28991d56f357 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 6 Mar 2023 14:38:31 +0100 Subject: [PATCH] Rename the "codechecker" command to "phpcs" Just to be better aligned with other commands. The original name comes from the times that we needed local_codechecker (that used to contain the moodle standard). But that's not the case any more. Of course, we keep the old "codechecker" working as command alias, so this change should be 100% BC compatible with current configurations / uses. --- .github/workflows/test.yml | 3 +- .travis.yml | 1 + docs/CHANGELOG.md | 2 + docs/CLI.md | 214 +++++++++++++++-------------- src/Command/CodeCheckerCommand.php | 3 +- src/Command/CodeFixerCommand.php | 1 + 6 files changed, 117 insertions(+), 107 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2afc6bad..1576d729 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,7 +102,8 @@ jobs: moodle-plugin-ci phplint moodle-plugin-ci phpcpd moodle-plugin-ci phpmd - moodle-plugin-ci codechecker + moodle-plugin-ci phpcs + moodle-plugin-ci phpcbf moodle-plugin-ci validate moodle-plugin-ci savepoints moodle-plugin-ci mustache diff --git a/.travis.yml b/.travis.yml index 658fef4b..4c9134f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ script: - moodle-plugin-ci phpcpd - moodle-plugin-ci phpmd - moodle-plugin-ci codechecker + - moodle-plugin-ci codefixer - moodle-plugin-ci validate - moodle-plugin-ci savepoints - moodle-plugin-ci mustache diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e60a761f..4b127b54 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt ## [Unreleased] ### Changed - Modified the Travis templates and docs to point that, since [MDL-75012](https://tracker.moodle.org/browse/MDL-75012) (core update to Node 18), Ubuntu Focal 20.04 is the minimum required by runs. +- ACTION REQUIRED: Review any Travis configuration for 39_STABLE and up. Now they require Ubuntu 20.04 (focal) to be specified. +- The `codechecker` command has been rename to `phpcs`, to better match other command names. The old name remains as alias, so no change is required. ## [3.4.7] - 2023-03-04 ### Changed diff --git a/docs/CLI.md b/docs/CLI.md index 14ead49d..b8fd474b 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -8,7 +8,8 @@ title: Moodle Plugin CI Commands * [`add-config`](#add-config) * [`add-plugin`](#add-plugin) * [`behat`](#behat) -* [`codechecker`](#codechecker) +* [`codechecker`](#phpcs) +* [`codefixer`](#phpcbf) * [`coveralls-upload`](#coveralls-upload) * [`grunt`](#grunt) * [`help`](#help) @@ -18,6 +19,7 @@ title: Moodle Plugin CI Commands * [`parallel`](#parallel) * [`phpcbf`](#phpcbf) * [`phpcpd`](#phpcpd) +* [`phpcs`](#phpcs) * [`phpdoc`](#phpdoc) * [`phplint`](#phplint) * [`phpmd`](#phpmd) @@ -373,110 +375,6 @@ Do not ask any interactive question * Is multiple: no * Default: `false` -`codechecker` -------------- - -Run Moodle CodeSniffer standard on a plugin - -### Usage - -* `codechecker [-s|--standard STANDARD] [--max-warnings MAX-WARNINGS] [--] ` - -Run Moodle CodeSniffer standard on a plugin - -### Arguments - -#### `plugin` - -Path to the plugin - -* Is required: yes -* Is array: no -* Default: `NULL` - -### Options - -#### `--standard|-s` - -The name or path of the coding standard to use - -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Default: `'moodle'` - -#### `--max-warnings` - -Number of warnings to trigger nonzero exit code - default: -1 - -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Default: `-1` - -#### `--help|-h` - -Display this help message - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--quiet|-q` - -Do not output any message - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--verbose|-v|-vv|-vvv` - -Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--version|-V` - -Display this application version - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--ansi` - -Force ANSI output - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--no-ansi` - -Disable ANSI output - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - -#### `--no-interaction|-n` - -Do not ask any interactive question - -* Accept value: no -* Is value required: no -* Is multiple: no -* Default: `false` - `coveralls-upload` ------------------ @@ -1279,6 +1177,7 @@ Run Code Beautifier and Fixer on a plugin ### Usage * `phpcbf [-s|--standard STANDARD] [--] ` +* `codefixer` Run Code Beautifier and Fixer on a plugin @@ -1452,6 +1351,111 @@ Do not ask any interactive question * Is multiple: no * Default: `false` +`phpcs` +------- + +Run Moodle CodeSniffer standard on a plugin + +### Usage + +* `phpcs [-s|--standard STANDARD] [--max-warnings MAX-WARNINGS] [--] ` +* `codechecker` + +Run Moodle CodeSniffer standard on a plugin + +### Arguments + +#### `plugin` + +Path to the plugin + +* Is required: yes +* Is array: no +* Default: `NULL` + +### Options + +#### `--standard|-s` + +The name or path of the coding standard to use + +* Accept value: yes +* Is value required: yes +* Is multiple: no +* Default: `'moodle'` + +#### `--max-warnings` + +Number of warnings to trigger nonzero exit code - default: -1 + +* Accept value: yes +* Is value required: yes +* Is multiple: no +* Default: `-1` + +#### `--help|-h` + +Display this help message + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--quiet|-q` + +Do not output any message + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--verbose|-v|-vv|-vvv` + +Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--version|-V` + +Display this application version + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--ansi` + +Force ANSI output + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--no-ansi` + +Disable ANSI output + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + +#### `--no-interaction|-n` + +Do not ask any interactive question + +* Accept value: no +* Is value required: no +* Is multiple: no +* Default: `false` + `phpdoc` -------- diff --git a/src/Command/CodeCheckerCommand.php b/src/Command/CodeCheckerCommand.php index ae7e39cf..ca3bd8d1 100644 --- a/src/Command/CodeCheckerCommand.php +++ b/src/Command/CodeCheckerCommand.php @@ -35,7 +35,8 @@ protected function configure() { parent::configure(); - $this->setName('codechecker') + $this->setName('phpcs') + ->setAliases(['codechecker']) ->setDescription('Run Moodle CodeSniffer standard on a plugin') ->addOption('standard', 's', InputOption::VALUE_REQUIRED, 'The name or path of the coding standard to use', 'moodle') ->addOption('max-warnings', null, InputOption::VALUE_REQUIRED, diff --git a/src/Command/CodeFixerCommand.php b/src/Command/CodeFixerCommand.php index 9bf416b9..018c6c12 100644 --- a/src/Command/CodeFixerCommand.php +++ b/src/Command/CodeFixerCommand.php @@ -28,6 +28,7 @@ protected function configure() AbstractPluginCommand::configure(); $this->setName('phpcbf') + ->setAliases(['codefixer']) ->setDescription('Run Code Beautifier and Fixer on a plugin') ->addOption('standard', 's', InputOption::VALUE_REQUIRED, 'The name or path of the coding standard to use', 'moodle'); }