fix(PROW-124): Some tweaks for backend linting#4
Merged
mikemeijer merged 3 commits intomainfrom Jun 18, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refines backend linting by including additional directories for ECS, updating PHPStan ignore rules, tweaking ECS rule configurations (commenting out and adjusting some rule settings, plus skip patterns), and refreshing installation and lint command instructions in the README.
- Add
routes,database, andconfigpaths to the ECS stub. - Expand PHPStan ignore patterns for undefined
$thisin tests and child return types in factories. - Comment out or adjust several ECS sniffs and introduce skip patterns for common directories.
- Update README with the new package name and lint:fix command.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/php-linting-rules/stubs/ecs.php.dist | Include additional project paths for ECS linting |
| packages/php-linting-rules/configs/phpstan.neon | Add ignore rules for undefined $this and child return types |
| packages/php-linting-rules/configs/ecs.php | Comment out/adjust various coding standard rules and add skip patterns |
| packages/php-linting-rules/README.md | Rename composer require package and add lint:fix command |
Comments suppressed due to low confidence (3)
packages/php-linting-rules/README.md:23
- The README adds
composer lint:fix—ensure there's a correspondinglint:fixscript defined incomposer.jsonso that the command works as documented.
composer require --dev programic/php-linting-rules
packages/php-linting-rules/configs/ecs.php:57
- PSR-12 requires the namespace declaration to be the first statement without preceding blank lines. Changing
linesCountBeforeNamespaceto 1 introduces a blank line before the namespace; consider reverting to 0 or explicitly documenting this deviation.
->withConfiguredRule(SlevomatCodingStandard\Sniffs\Namespaces\NamespaceSpacingSniff::class, ['linesCountBeforeNamespace' => 1, 'linesCountAfterNamespace' => 1])
packages/php-linting-rules/configs/ecs.php:41
- [nitpick] Commented-out rule lines can clutter the config. Consider removing these entries or moving them to a documented changelog so the config remains clean and maintainable.
// ->withConfiguredRule(SlevomatCodingStandard\Sniffs\Classes\EmptyLinesAroundClassBracesSniff::class, ['linesCountAfterOpeningBrace' => 0, 'linesCountBeforeClosingBrace' => 0])
thomtijdink
approved these changes
Jun 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disables some conflicting rules