Skip to content

[TASK] Move linting to a Composer script and use it on CI #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
ini-file: development
tools: composer:v2
coverage: none

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

unit-tests:
name: Unit tests
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@
"ci:dynamic": [
"@ci:tests"
],
"ci:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests",
"ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
"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",
"ci:php:lint": "find src tests config bin -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l",
"ci:php:rector": "rector --no-progress-bar --dry-run --config=config/rector.php",
"ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
"ci:static": [
"@ci:php:fixer",
"@ci:php:lint",
"@ci:php:rector",
"@ci:php:stan"
],
Expand All @@ -94,6 +96,7 @@
"ci": "Runs all dynamic and static code checks.",
"ci:dynamic": "Runs all dynamic code checks (i.e., currently, the unit tests).",
"ci:php:fixer": "Checks the code style with PHP CS Fixer.",
"ci:php:lint": "Checks the syntax of the PHP code.",
"ci:php:stan": "Checks the types with PHPStan.",
"ci:php:rector": "Checks the code for possible code updates and refactoring.",
"ci:static": "Runs all static code analysis checks for the code.",
Expand Down