Skip to content

Commit 059c1bb

Browse files
committed
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.
1 parent e2c9b7a commit 059c1bb

File tree

6 files changed

+117
-107
lines changed

6 files changed

+117
-107
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ jobs:
102102
moodle-plugin-ci phplint
103103
moodle-plugin-ci phpcpd
104104
moodle-plugin-ci phpmd
105-
moodle-plugin-ci codechecker
105+
moodle-plugin-ci phpcs
106+
moodle-plugin-ci phpcbf
106107
moodle-plugin-ci validate
107108
moodle-plugin-ci savepoints
108109
moodle-plugin-ci mustache

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ script:
5353
- moodle-plugin-ci phpcpd
5454
- moodle-plugin-ci phpmd
5555
- moodle-plugin-ci codechecker
56+
- moodle-plugin-ci codefixer
5657
- moodle-plugin-ci validate
5758
- moodle-plugin-ci savepoints
5859
- moodle-plugin-ci mustache

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1111
## [Unreleased]
1212
### Changed
1313
- 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.
14+
- ACTION REQUIRED: Review any Travis configuration for 39_STABLE and up. Now they require Ubuntu 20.04 (focal) to be specified.
15+
- 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.
1416

1517
## [3.4.7] - 2023-03-04
1618
### Changed

docs/CLI.md

Lines changed: 109 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ title: Moodle Plugin CI Commands
88
* [`add-config`](#add-config)
99
* [`add-plugin`](#add-plugin)
1010
* [`behat`](#behat)
11-
* [`codechecker`](#codechecker)
11+
* [`codechecker`](#phpcs)
12+
* [`codefixer`](#phpcbf)
1213
* [`coveralls-upload`](#coveralls-upload)
1314
* [`grunt`](#grunt)
1415
* [`help`](#help)
@@ -18,6 +19,7 @@ title: Moodle Plugin CI Commands
1819
* [`parallel`](#parallel)
1920
* [`phpcbf`](#phpcbf)
2021
* [`phpcpd`](#phpcpd)
22+
* [`phpcs`](#phpcs)
2123
* [`phpdoc`](#phpdoc)
2224
* [`phplint`](#phplint)
2325
* [`phpmd`](#phpmd)
@@ -373,110 +375,6 @@ Do not ask any interactive question
373375
* Is multiple: no
374376
* Default: `false`
375377

376-
`codechecker`
377-
-------------
378-
379-
Run Moodle CodeSniffer standard on a plugin
380-
381-
### Usage
382-
383-
* `codechecker [-s|--standard STANDARD] [--max-warnings MAX-WARNINGS] [--] <plugin>`
384-
385-
Run Moodle CodeSniffer standard on a plugin
386-
387-
### Arguments
388-
389-
#### `plugin`
390-
391-
Path to the plugin
392-
393-
* Is required: yes
394-
* Is array: no
395-
* Default: `NULL`
396-
397-
### Options
398-
399-
#### `--standard|-s`
400-
401-
The name or path of the coding standard to use
402-
403-
* Accept value: yes
404-
* Is value required: yes
405-
* Is multiple: no
406-
* Default: `'moodle'`
407-
408-
#### `--max-warnings`
409-
410-
Number of warnings to trigger nonzero exit code - default: -1
411-
412-
* Accept value: yes
413-
* Is value required: yes
414-
* Is multiple: no
415-
* Default: `-1`
416-
417-
#### `--help|-h`
418-
419-
Display this help message
420-
421-
* Accept value: no
422-
* Is value required: no
423-
* Is multiple: no
424-
* Default: `false`
425-
426-
#### `--quiet|-q`
427-
428-
Do not output any message
429-
430-
* Accept value: no
431-
* Is value required: no
432-
* Is multiple: no
433-
* Default: `false`
434-
435-
#### `--verbose|-v|-vv|-vvv`
436-
437-
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
438-
439-
* Accept value: no
440-
* Is value required: no
441-
* Is multiple: no
442-
* Default: `false`
443-
444-
#### `--version|-V`
445-
446-
Display this application version
447-
448-
* Accept value: no
449-
* Is value required: no
450-
* Is multiple: no
451-
* Default: `false`
452-
453-
#### `--ansi`
454-
455-
Force ANSI output
456-
457-
* Accept value: no
458-
* Is value required: no
459-
* Is multiple: no
460-
* Default: `false`
461-
462-
#### `--no-ansi`
463-
464-
Disable ANSI output
465-
466-
* Accept value: no
467-
* Is value required: no
468-
* Is multiple: no
469-
* Default: `false`
470-
471-
#### `--no-interaction|-n`
472-
473-
Do not ask any interactive question
474-
475-
* Accept value: no
476-
* Is value required: no
477-
* Is multiple: no
478-
* Default: `false`
479-
480378
`coveralls-upload`
481379
------------------
482380

@@ -1279,6 +1177,7 @@ Run Code Beautifier and Fixer on a plugin
12791177
### Usage
12801178

12811179
* `phpcbf [-s|--standard STANDARD] [--] <plugin>`
1180+
* `codefixer`
12821181

12831182
Run Code Beautifier and Fixer on a plugin
12841183

@@ -1452,6 +1351,111 @@ Do not ask any interactive question
14521351
* Is multiple: no
14531352
* Default: `false`
14541353

1354+
`phpcs`
1355+
-------
1356+
1357+
Run Moodle CodeSniffer standard on a plugin
1358+
1359+
### Usage
1360+
1361+
* `phpcs [-s|--standard STANDARD] [--max-warnings MAX-WARNINGS] [--] <plugin>`
1362+
* `codechecker`
1363+
1364+
Run Moodle CodeSniffer standard on a plugin
1365+
1366+
### Arguments
1367+
1368+
#### `plugin`
1369+
1370+
Path to the plugin
1371+
1372+
* Is required: yes
1373+
* Is array: no
1374+
* Default: `NULL`
1375+
1376+
### Options
1377+
1378+
#### `--standard|-s`
1379+
1380+
The name or path of the coding standard to use
1381+
1382+
* Accept value: yes
1383+
* Is value required: yes
1384+
* Is multiple: no
1385+
* Default: `'moodle'`
1386+
1387+
#### `--max-warnings`
1388+
1389+
Number of warnings to trigger nonzero exit code - default: -1
1390+
1391+
* Accept value: yes
1392+
* Is value required: yes
1393+
* Is multiple: no
1394+
* Default: `-1`
1395+
1396+
#### `--help|-h`
1397+
1398+
Display this help message
1399+
1400+
* Accept value: no
1401+
* Is value required: no
1402+
* Is multiple: no
1403+
* Default: `false`
1404+
1405+
#### `--quiet|-q`
1406+
1407+
Do not output any message
1408+
1409+
* Accept value: no
1410+
* Is value required: no
1411+
* Is multiple: no
1412+
* Default: `false`
1413+
1414+
#### `--verbose|-v|-vv|-vvv`
1415+
1416+
Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
1417+
1418+
* Accept value: no
1419+
* Is value required: no
1420+
* Is multiple: no
1421+
* Default: `false`
1422+
1423+
#### `--version|-V`
1424+
1425+
Display this application version
1426+
1427+
* Accept value: no
1428+
* Is value required: no
1429+
* Is multiple: no
1430+
* Default: `false`
1431+
1432+
#### `--ansi`
1433+
1434+
Force ANSI output
1435+
1436+
* Accept value: no
1437+
* Is value required: no
1438+
* Is multiple: no
1439+
* Default: `false`
1440+
1441+
#### `--no-ansi`
1442+
1443+
Disable ANSI output
1444+
1445+
* Accept value: no
1446+
* Is value required: no
1447+
* Is multiple: no
1448+
* Default: `false`
1449+
1450+
#### `--no-interaction|-n`
1451+
1452+
Do not ask any interactive question
1453+
1454+
* Accept value: no
1455+
* Is value required: no
1456+
* Is multiple: no
1457+
* Default: `false`
1458+
14551459
`phpdoc`
14561460
--------
14571461

src/Command/CodeCheckerCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ protected function configure()
3535
{
3636
parent::configure();
3737

38-
$this->setName('codechecker')
38+
$this->setName('phpcs')
39+
->setAliases(['codechecker'])
3940
->setDescription('Run Moodle CodeSniffer standard on a plugin')
4041
->addOption('standard', 's', InputOption::VALUE_REQUIRED, 'The name or path of the coding standard to use', 'moodle')
4142
->addOption('max-warnings', null, InputOption::VALUE_REQUIRED,

src/Command/CodeFixerCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ protected function configure()
2828
AbstractPluginCommand::configure();
2929

3030
$this->setName('phpcbf')
31+
->setAliases(['codefixer'])
3132
->setDescription('Run Code Beautifier and Fixer on a plugin')
3233
->addOption('standard', 's', InputOption::VALUE_REQUIRED, 'The name or path of the coding standard to use', 'moodle');
3334
}

0 commit comments

Comments
 (0)