Skip to content

Update wp-coding-standards/wpcs to 3.4.1 - #497

Merged
pattonwebz merged 1 commit into
WordPress:masterfrom
obenland:update/wpcs-3.4.1
Jul 27, 2026
Merged

Update wp-coding-standards/wpcs to 3.4.1#497
pattonwebz merged 1 commit into
WordPress:masterfrom
obenland:update/wpcs-3.4.1

Conversation

@obenland

Copy link
Copy Markdown
Member

Migrates off the WPCS 2.x pin. CI runs a full phpcs scan here, so this covers everything needed to stay green:

What changed

  • Bumps wp-coding-standards/wpcs from ^2.3 to ^3.4.1 and regenerates composer.lock.
  • Renames existing ruleset excludes to their WPCS 3.x sniff names, so the intent already documented in the ruleset keeps applying: WordPress.PHP.StrictComparisons.LooseComparisonUniversal.Operators.StrictComparisons ("We're not strict about this") and WordPress.CodeAnalysis.AssignmentInCondition.*Generic.CodeAnalysis.AssignmentInCondition.* ("We want to allow this"). Under WPCS 3 the old names silently stopped matching, which is why those violations resurfaced.
  • Excludes two sniffs newly introduced in WPCS 3.x whose fixes require restructuring code (Universal.ControlStructures.DisallowLonelyIf, Universal.Files.SeparateFunctionsFromOO) — left as maintainer judgment calls.
  • Applies safe phpcbf fixes for the remaining new violations: standalone $i++++$i, comma spacing, brace placement, space after function. No behavior changes.
  • Removes the error_reporting ini workaround for WPCS's old PHP 8.0+ support gap (WPCS#2035) — obsolete with WPCS 3.x.

Verification: full phpcs scan is clean, matching the pre-update baseline.

Part of an org-wide sweep to get all repos onto WPCS 3.4.1.

🤖 Generated with Claude Code

- Bump the constraint from ^2.3 to ^3.4.1 and regenerate composer.lock.
- Rename existing ruleset excludes to their WPCS 3.x sniff names so the
  documented intent keeps applying: loose comparisons
  (WordPress.PHP.StrictComparisons -> Universal.Operators.StrictComparisons)
  and assignment in condition (WordPress.CodeAnalysis -> Generic.CodeAnalysis).
- Exclude two sniffs new in WPCS 3.x that would require restructuring
  (DisallowLonelyIf, SeparateFunctionsFromOO).
- Apply safe phpcbf fixes for the remaining new violations (increment
  operators, comma spacing, brace placement).
- Remove the error_reporting workaround for WPCS's old PHP 8 support
  gap; WPCS 3.x supports current PHP.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated no new comments.

@obenland

Copy link
Copy Markdown
Member Author

@carolinan @Otto42 Could I ask for your help with merging this? I don't seem to have access.

@pattonwebz

Copy link
Copy Markdown
Member

This looks good to me, I can merge it if you like @obenland

@obenland

Copy link
Copy Markdown
Member Author

Thanks, that would be great

@pattonwebz
pattonwebz merged commit 4e03f4b into WordPress:master Jul 27, 2026
1 check passed
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.

3 participants