Repository navigation
Conversation
Adi-ty
marked this pull request as ready for review
November 5, 2026 11:39
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
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.
What this PR does
Makes
ci-lint-php.ymlannotate PHPCS and PHPStan results on the right files in a monorepo, caches both linters' results, and lets the ruleset decide whether PHPCS warnings fail the job.Closes
Part of #51
Changes
cs2prand prints--report-fullin the log, so every violation shows with file and line, including those past GitHub's 10-annotations-per-step limit.--basepath=$GITHUB_WORKSPACEmakes annotation paths repo-relative in a monorepo.--error-format=checkstyleand is annotated throughcs2pr. Relative paths get the working-dir prefix so they resolve from the repo root; absolute paths and non-file errors pass through unchanged.tmpDir, with a per-run key and arestore-keysprefix of OS, PHP version, working-dir and thecomposer.lockhash.tmpDircomes fromphpstan dump-parameters --json; if that fails, only the PHPStan cache is skipped.--runtime-set ignore_warnings_on_exit 1: PHPCS warnings now fail the job unless the ruleset sets<config name="ignore_warnings_on_exit" value="1"/>. The CLI flag also overrode a ruleset that wanted warnings to fail.phpcs-command/phpstan-commanddescriptions say the command must forward its arguments.How I verified
Ran the extracted step bodies in a php:8.3 container (PHPCS 3.13.6 and 4.0.4, PHPStan 2.3.5): 24/24 cases, covering monorepo and root annotation paths, warnings with and without the ruleset opt-out, cache write and reuse, the wp-phpcs template args, PHPStan unmatched ignores and non-file errors, and a symlinked workspace. Also ran the PHPStan step on macOS (bash 3.2, BSD sed).
Acceptance criteria
Runtime behavior
phpcs-command/phpstan-commandstill receive the flags as argvCode quality
actionlintcleanbin/check-workflows.shHousekeeping
examples/ci-lint-php.ymlunchanged (no input changes)yamllint,actionlint,bin/check-workflows.shpassReviewer notes
@v1callers: a ruleset withoutignore_warnings_on_exitnow fails on warnings. Shipped asfeat, notfeat!, so v1 callers get it; say if you'd treat it as breaking.phpstan-commandthat points PHPStan at another config may miss the cache, sincetmpDiris read from the default config; it still runs.actions/cache; whichever merges second aligns the pins.Conventions: AGENTS.md · PR process: CONTRIBUTING.md