Skip to content

fix(PROW-124): Some tweaks for backend linting#4

Merged
mikemeijer merged 3 commits intomainfrom
bugfix/PROW-124
Jun 18, 2025
Merged

fix(PROW-124): Some tweaks for backend linting#4
mikemeijer merged 3 commits intomainfrom
bugfix/PROW-124

Conversation

@mikemeijer
Copy link
Copy Markdown
Contributor

@mikemeijer mikemeijer commented Jun 18, 2025

Disables some conflicting rules

@mikemeijer mikemeijer self-assigned this Jun 18, 2025
Copilot AI review requested due to automatic review settings June 18, 2025 07:25

This comment was marked as outdated.

@mikemeijer mikemeijer requested a review from Copilot June 18, 2025 07:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and config paths to the ECS stub.
  • Expand PHPStan ignore patterns for undefined $this in 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 corresponding lint:fix script defined in composer.json so 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 linesCountBeforeNamespace to 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])

Comment thread packages/php-linting-rules/configs/phpstan.neon
@mikemeijer mikemeijer merged commit 36596bf into main Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants