Run PHP coding standards when dependencies change - #644
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The phpcs job only ran when a **.php file changed, so a pull request that changed the project's dependencies went unchecked. The WPCS 3.4.1 update was exactly that: it changed composer.lock only, swapped the whole coding-standards ruleset underneath, and no lint ran on it. Adds composer.json and composer.lock to the filter. This repo gates differently from its siblings: `pull_request` has no `paths` filter, and the `phpcs` job is instead gated on a `dorny/paths-filter` step carrying the same `**.php` list. The effect was identical — a `composer.lock`-only PR skipped the job — so both the `push` `paths` block and the `filters` block are updated.
0a53f24 to
deeb77a
Compare
Changes proposed in this Pull Request:
The PHP coding standards job only runs when a
**.phpfile changes. That leaves a gap: a pull request that changes the project's dependencies is never linted, even though dependencies are what supply the coding standards themselves.This is not hypothetical. The recent WPCS 3.4.1 update (GHSA-3pwp-g2mj-5p3v) touched
composer.lockonly. It replaced the entire coding-standards ruleset and no lint job ran on it.This adds
composer.jsonandcomposer.lockto the filter.This repo gates differently from its siblings:
pull_requesthas nopathsfilter, and thephpcsjob is instead gated on adorny/paths-filterstep carrying the same**.phplist. The effect was identical — acomposer.lock-only PR skipped the job — so both thepushpathsblock and thefiltersblock are updated.Detailed test instructions:
This changes when the workflow fires, not what it does, so the check is behavioural:
.github/workflows/php-coding-standards.yml, which was already in the filter.composer.lock(a whitespace edit is enough) and confirm the job still triggers. Before this change it would not have.Additional details:
No change to what phpcs does or which rules apply — only to when the job is triggered. The cost is that dependency-only pull requests now run one extra short job.
An earlier version of this PR also added
phpcs.xml.distto the filter. That is pulled out and left for a separate discussion: changing the lint config can surface pre-existing violations across the whole tree, and that deserves its own decision rather than riding along here.Changelog entry