Repository navigation
ci: print the full PHPCS report alongside cs2pr annotations - #64
Conversation
Write the checkstyle report to a file so the log also shows the readable full report, and run cs2pr on it in a following step that runs even when PHPCS fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016QZq4rvW3EzGU1QRh7T7qi
Up to standards ✅🟢 Issues
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🟢 Approval recommended
The CI workflow change is self-contained and correct, with valid PHPCS reporting, preserved job-failure behavior, and a well-guarded annotation step, leaving no outstanding issues.
No open issues 🎉
What changed in this PR
This PR improves the developer experience of the phpcs ("Coding standards") CI job in .github/workflows/tests.yml. Previously PHPCS piped only a checkstyle report into cs2pr, producing PR annotations but no human-readable list in the workflow log. The change makes PHPCS print a full report to the log while also writing the checkstyle file consumed by cs2pr in a separate annotation step, so both a readable log and PR annotations are available even when the lint step fails.
Changes:
- Replace
vendor/bin/phpcs -q --report=checkstyle | cs2prwithvendor/bin/phpcs -q --report-full --report-checkstyle=phpcs-report.xml, so the step's own exit code (no longer hidden behind a pipe) fails the job on violations and the full report is visible in the log. - Add an "Annotate PHPCS violations" step running
cs2pr phpcs-report.xml, guarded byif: always() && hashFiles('phpcs-report.xml') != ''so annotations still render when PHPCS fails and are skipped if the report was never written.
| File | Description |
|---|---|
.github/workflows/tests.yml |
Splits PHPCS linting into a full-report run plus a separate cs2pr annotation step so the log shows a readable report while PR annotations and job-failure behavior are preserved. |
Review effort: Balanced
Description
The
phpcs("Coding standards") job intests.ymlalready checks the WordPress Coding Standards on every PR. Until now it piped only the checkstyle report intocs2pr, so when it failed you saw PR annotations but no readable list in the log.This PR changes it to:
vendor/bin/phpcs -q --report-full --report-checkstyle=phpcs-report.xml, which prints the full report to the log and writes the checkstyle report to a filecs2pr phpcs-report.xmlin a new step, "Annotate PHPCS violations", usingif: always() && hashFiles('phpcs-report.xml') != '', so annotations still appear when the PHPCS step failsThe PHPCS step still fails the job when there are violations, because its exit code is no longer hidden behind a pipe.
Related Issue
None.
Type of Change
Checklist
Testing Instructions
main:vendor/bin/phpcs -q --report-full --report-checkstyle=out.xmlexits 0 and writes an empty checkstyle file.<error>entries to the checkstyle file.actionlintwasn't available.Additional Notes
No plugin code changes.
Generated by Claude Code