Skip to content

Commit 447fcb8

Browse files
authored
[TASK] Streamline the code checker and fixer configuration (#1535)
- always check and fix the `bin/`, `config/`, `src/` and `test/` directories - sort the directories when provided to a tool - make the rector command explicit
1 parent a3cc167 commit 447fcb8

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
"check:dynamic": [
7777
"@check:tests"
7878
],
79-
"check:php:codesniffer": "phpcs --standard=config/phpcs.xml config src tests",
80-
"check:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests config",
81-
"check:php:lint": "parallel-lint src tests config bin",
82-
"check:php:rector": "rector --no-progress-bar --dry-run --config=config/rector.php",
79+
"check:php:codesniffer": "phpcs --standard=config/phpcs.xml bin config src tests",
80+
"check:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin config src tests",
81+
"check:php:lint": "parallel-lint bin config src tests",
82+
"check:php:rector": "rector process --no-progress-bar --dry-run --config=config/rector.php",
8383
"check:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
8484
"check:static": [
8585
"@check:composer:normalize",
@@ -105,9 +105,9 @@
105105
"@fix:php:codesniffer",
106106
"@fix:php:fixer"
107107
],
108-
"fix:php:codesniffer": "phpcbf --standard=config/phpcs.xml config src tests",
109-
"fix:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix bin src tests",
110-
"fix:php:rector": "rector --config=config/rector.php",
108+
"fix:php:codesniffer": "phpcbf --standard=config/phpcs.xml bin config src tests",
109+
"fix:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix bin config src tests",
110+
"fix:php:rector": "rector process --config=config/rector.php",
111111
"phpstan:baseline": "phpstan --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon --allow-empty-baseline"
112112
},
113113
"scripts-descriptions": {

config/php-cs-fixer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
declare(strict_types=1);
44

5-
return (new \PhpCsFixer\Config())
5+
use PhpCsFixer\Config;
6+
7+
return (new Config())
68
->setRiskyAllowed(true)
79
->setRules(
810
[

config/rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
return RectorConfig::configure()
1111
->withPaths(
1212
[
13+
__DIR__ . '/../bin',
14+
__DIR__ . '/../config',
1315
__DIR__ . '/../src',
1416
__DIR__ . '/../tests',
1517
]

0 commit comments

Comments
 (0)