Skip to content

Commit ca9c54e

Browse files
authored
[TASK] Move linting to a Composer script and use it on CI (#565)
Also lint `config/` in order to catch e.g. language features that are not supported in all the PHP versions we support. Fixes: #551 Signed-off-by: Daniel Ziegenberg <[email protected]>
1 parent 49262ad commit ca9c54e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ jobs:
2727
with:
2828
php-version: ${{ matrix.php-version }}
2929
ini-file: development
30+
tools: composer:v2
3031
coverage: none
3132

3233
- name: PHP Lint
33-
run: find src tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
34+
run: composer ci:php:lint
3435

3536
unit-tests:
3637
name: Unit tests

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@
6969
"ci:dynamic": [
7070
"@ci:tests"
7171
],
72-
"ci:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests",
73-
"ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
72+
"ci:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests config",
73+
"ci:php:lint": "find src tests config bin -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l",
7474
"ci:php:rector": "rector --no-progress-bar --dry-run --config=config/rector.php",
75+
"ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
7576
"ci:static": [
7677
"@ci:php:fixer",
78+
"@ci:php:lint",
7779
"@ci:php:rector",
7880
"@ci:php:stan"
7981
],
@@ -94,6 +96,7 @@
9496
"ci": "Runs all dynamic and static code checks.",
9597
"ci:dynamic": "Runs all dynamic code checks (i.e., currently, the unit tests).",
9698
"ci:php:fixer": "Checks the code style with PHP CS Fixer.",
99+
"ci:php:lint": "Checks the syntax of the PHP code.",
97100
"ci:php:stan": "Checks the types with PHPStan.",
98101
"ci:php:rector": "Checks the code for possible code updates and refactoring.",
99102
"ci:static": "Runs all static code analysis checks for the code.",

0 commit comments

Comments
 (0)