Repository navigation
Run PHP coding standards when dependencies change - #257
Merged
Merged
Conversation
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. No changelog entry: this touches repo CI config, not the `github-actions`, `jsdoc` or `tracking-jsdoc` packages.
triple0t
force-pushed
the
update/phpcs-workflow-trigger-paths
branch
from
July 28, 2026 12:19
7c39f16 to
89c12d7
Compare
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.
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.No changelog entry: this touches repo CI config, not the
github-actions,jsdocortracking-jsdocpackages.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.