Skip to content

fix: resolve PHPCS false-positives blocking release lint#64

Open
chubes4 wants to merge 1 commit into
mainfrom
phpcs-fix
Open

fix: resolve PHPCS false-positives blocking release lint#64
chubes4 wants to merge 1 commit into
mainfrom
phpcs-fix

Conversation

@chubes4

@chubes4 chubes4 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

The homeboy release extrachill lint gate was reported as failing on pre-existing PHPCS errors. Investigation shows the homeboy release gate itself already passes clean (homeboy lint extrachill → phpcs/eslint/phpstan all 0 findings, exit 0) at the release commit. The "thousands of errors" come from the repo's own composer lint:php script, which ran vendor/bin/phpcs --standard=WordPress . — scanning the entire tree (2058 files, including vendor/ and node_modules/). Those are third-party false positives, not first-party debt.

This PR aligns the repo's own lint with the gate that actually governs releases.

What changed

  • New phpcs.xml.dist mirroring the homeboy release lint ruleset:
    • WordPress-Extra with the same rule exclusions homeboy uses (naming-convention + conflicting spacing sniffs).
    • Excludes vendor/, node_modules/, build/, dist/, languages/.
    • testVersion 7.4-.
  • composer.json: lint:php / lint:fix / test now use the config file (dropped hardcoded --standard=WordPress .), so phpcs auto-discovers phpcs.xml.dist.
  • .buildignore: exclude phpcs.xml.dist from the release artifact (dev-only config).

Result

Scan Before After
composer lint:php scope 2058 files (whole tree) 41 first-party files
composer lint:php result thousands of vendor errors 0 errors, exit 0
homeboy lint extrachill already passing (0/0/0) still passing (0/0/0)

Triage notes (auto-fixed vs hand-fixed)

  • No first-party PHP source was modified. The strict upstream WordPress standard (everything on) would flag ~120 first-party style items (docblock spacing, superglobal sanitization, etc.), but the homeboy release gate does not enforce those rule groups — so none of them block releases. Suppressing legitimate signal was avoided by mirroring the gate's ruleset exactly rather than inventing a looser one.
  • No homeboy false-positive issue filed. Homeboy's own phpcs.xml.dist already excludes vendor//node_modules//build/, so homeboy's lint scope is correct. The false positives lived in the repo's composer script, which this PR fixes at the repo level (per the task's Step 2b).

Constraints honored

  • PR only — no release, deploy, merge, changelog edit, or version bump.
  • Conventional commit.

The composer lint:php/test scripts ran phpcs --standard=WordPress .,
scanning the entire tree (2058 files) including vendor/ and
node_modules/ and reporting thousands of third-party false positives.

Add a phpcs.xml.dist that mirrors the homeboy release lint gate
(WordPress-Extra with the same rule exclusions, vendor/build/node_modules
excluded, testVersion 7.4-). The repo now scans 41 first-party files and
passes clean (0 errors), matching the homeboy gate that governs releases.

Point composer scripts at the config (drop the hardcoded --standard=WordPress .)
and exclude phpcs.xml.dist from the build artifact.
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.

1 participant