Skip to content

Commit

Permalink
Rename the "codechecker" command to "phpcs"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stronk7 committed Mar 6, 2023
1 parent e2c9b7a commit 059c1bb
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 107 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
214 changes: 109 additions & 105 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -18,6 +19,7 @@ title: Moodle Plugin CI Commands
* [`parallel`](#parallel)
* [`phpcbf`](#phpcbf)
* [`phpcpd`](#phpcpd)
* [`phpcs`](#phpcs)
* [`phpdoc`](#phpdoc)
* [`phplint`](#phplint)
* [`phpmd`](#phpmd)
Expand Down Expand Up @@ -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] [--] <plugin>`

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`
------------------

Expand Down Expand Up @@ -1279,6 +1177,7 @@ Run Code Beautifier and Fixer on a plugin
### Usage

* `phpcbf [-s|--standard STANDARD] [--] <plugin>`
* `codefixer`

Run Code Beautifier and Fixer on a plugin

Expand Down Expand Up @@ -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] [--] <plugin>`
* `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`
--------

Expand Down
3 changes: 2 additions & 1 deletion src/Command/CodeCheckerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/Command/CodeFixerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 059c1bb

Please sign in to comment.