Update wp-coding-standards/wpcs to 3.4.1 - #497
Merged
Merged
Conversation
- 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>
Member
Author
|
@carolinan @Otto42 Could I ask for your help with merging this? I don't seem to have access. |
Member
|
This looks good to me, I can merge it if you like @obenland |
Member
Author
|
Thanks, that would be great |
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.
Migrates off the WPCS 2.x pin. CI runs a full
phpcsscan here, so this covers everything needed to stay green:What changed
^2.3to^3.4.1and regeneratescomposer.lock.WordPress.PHP.StrictComparisons.LooseComparison→Universal.Operators.StrictComparisons("We're not strict about this") andWordPress.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.Universal.ControlStructures.DisallowLonelyIf,Universal.Files.SeparateFunctionsFromOO) — left as maintainer judgment calls.phpcbffixes for the remaining new violations: standalone$i++→++$i, comma spacing, brace placement, space afterfunction. No behavior changes.error_reportingini workaround for WPCS's old PHP 8.0+ support gap (WPCS#2035) — obsolete with WPCS 3.x.Verification: full
phpcsscan 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