Skip to content

Relax WPCS version constraint to ^3#335

Open
kadamwhite wants to merge 2 commits into
mainfrom
relax-wpcs-constraint
Open

Relax WPCS version constraint to ^3#335
kadamwhite wants to merge 2 commits into
mainfrom
relax-wpcs-constraint

Conversation

@kadamwhite
Copy link
Copy Markdown
Collaborator

PHPCS will be pulled in as a transient dependency of both WPCS and VIPCS, so keeping it in our own composer.json does nothing but increase our maintenance burden.

The progressive point updates to WPCS in 3.1, 3.2 and 3.3 have improvements which would benefit HM projects and which make the coding standards more intuitively support modern versions of WordPress.

PHPCS will be pulled in as a transient dependency of both WPCS and VIPCS,
so keeping it in our own composer.json does nothing but increase our
maintenance burden.

The progressive point updates to WPCS in 3.1, 3.2 and 3.3 have improvements
which would benefit HM projects and which make the coding standards more
intuitively support modern versions of WordPress.
@kadamwhite kadamwhite requested review from joehoyle and rmccue May 28, 2026 17:26
@joehoyle
Copy link
Copy Markdown
Member

@kadamwhite given we integrated directly with PHP_Codesniffer, it would make sense to have it as a dependency. E.g. https://github.com/humanmade/coding-standards/blob/main/HM/Sniffs/Classes/OnlyClassInFileSniff.php. The reason we specify it is given we have code that relies specifically on certain versions of PHP Codesniffer means we should apply our own version constraint.

@kadamwhite
Copy link
Copy Markdown
Collaborator Author

@joehoyle what would you recommend for a constraint, WPCS specifies ^3.13.4

@joehoyle
Copy link
Copy Markdown
Member

joehoyle commented May 28, 2026

@kadamwhite it depends what we are compatible with, which I dont know. Perhaps it safe to go ^3, but I'm not totally sure!

- Our sniffs use standard stable PHPCS API (File, Sniff, Tokens, Config, AbstractSniffUnitTest, Ruleset, etc.) — available since PHPCS 3.0
- Binding floor from our direct deps: WPCS 3.3.0 requires ^3.13.4
- PHPCS 4.x: neither WPCS (^3.13.4) nor VIPCS (^3.9.2) support it, so we can't support it either
- Installed: PHPCS 3.13.5
@kadamwhite kadamwhite changed the title Relax WPCS version constraint to ^3, remove explicit PHPCS dependency Relax WPCS version constraint to ^3 May 28, 2026
@kadamwhite
Copy link
Copy Markdown
Collaborator Author

@joehoyle Reviewed our custom changes, ^3 feels safe. Since WPCS requires ^3.13 I've gone with that.

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.

2 participants