Skip to content

fix: resolve PHPCS errors blocking release - #33

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

fix: resolve PHPCS errors blocking release#33
chubes4 wants to merge 1 commit into
mainfrom
phpcs-fix

Conversation

@chubes4

@chubes4 chubes4 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Clears the PHPCS preflight gate that homeboy release extrachill-blog --apply runs, which was failing on pre-existing tech debt (~10 errors) unrelated to any recent feature and blocking release of already-merged work.

Verified against homeboy's exact gate ruleset (WordPress-Extra, PHP 7.4+, --warning-severity=0, vendor/build/dist/tests excluded): 0 errors, 0 warnings.

No false positives — no homeboy issue filed

Triage confirmed homeboy's lint scope is correct: it uses WordPress-Extra and already excludes vendor/, node_modules/, build/, dist/, tests/. Every flagged error was in first-party inc/ code. Nothing to file upstream.

Auto-fixed via phpcbf (formatting only, behavior-preserving)

  • Missing newline at EOF — admin-customizations.php, co-authors.php
  • Array double-arrow alignment + trailing multi-line commas — co-authors.php
  • Multi-line function-call argument wrapping — co-authors.php

Hand-fixed real errors

File Rule Fix
inc/home/templates/section-3x3-grid.php (×2) WordPress.WP.GlobalVariablesOverride Renamed local $title$item_title so the loop no longer clobbers WP's $title global
inc/core/ads-filter.php WordPress.PHP.YodaConditions (int) $context['blog_id'] !== 11 !== (int) $context['blog_id']
inc/single/login-register-cta.php WordPress.Security.EscapeOutput Added phpcs:ignore with justification on do_blocks() — it returns trusted, core-rendered block markup that must not be escaped (escaping would break the block HTML)

Verification

  • php -l clean on all 5 touched files
  • PHPCS with homeboy's exact gate args → ERRORS: 0 WARNINGS: 0
  • No query logic altered; SQL/$wpdb untouched (none of the errors involved SQL)

PR only — not merged, not released.

Clears the WordPress-Extra PHPCS gate (homeboy release preflight) which
was failing on pre-existing tech debt unrelated to any feature work.

Auto-fixed via phpcbf (formatting only, no behavior change):
- Missing newline at EOF (admin-customizations.php, co-authors.php)
- Array double-arrow alignment + trailing multiline commas (co-authors.php)
- Multi-line function-call arg wrapping (co-authors.php)

Hand-fixed real errors:
- section-3x3-grid.php: rename local $title -> $item_title to stop
  overriding the WP $title global (GlobalVariablesOverride, x2)
- ads-filter.php: Yoda condition (1 !== (int) blog_id)
- login-register-cta.php: annotate do_blocks() output with phpcs:ignore
  (trusted core-rendered block markup that must not be escaped)

No false positives found; homeboy lint scope (WordPress-Extra, vendor
excluded) is correct, so no homeboy issue filed.
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