WPTT / WPThemeReview

PHP_CodeSniffer rules (sniffs) to enforce WordPress theme review coding conventions
MIT License
208 stars 38 forks source link

Proposal: additional rulesets #168

Open jrfnl opened 6 years ago

jrfnl commented 6 years ago

As this repo was (is) a fork from WPCS, when this project started, it was decided to create a WordPress-Theme ruleset in line with existing rulesets in WPCS.

However, things change. And one of the things which is about to change is that the repo will be de-forked from WPCS.

This means that it can, from that point onwards, the TRTCS can choose its own standard name and have additional rulesets too.

Part 1 of this - standard name - is outlined in issue #167. This issue is about adding additional rulesets.

Proposal: have a WPTheme-Required and a WPTheme-Extra ruleset

WPCS has the WordPress-Core and WordPress-Extra rulesets, with WordPress-Core only containing the sniffs which are line with what's documented in the WP Core handbook and WordPress-Extra containing additional best practices and sniffs which are candidates to go into Core, but not yet discussed/approved.

Similar to this, I would like to suggest for this repo to also have two additional rulesets:

The "main" ruleset would then just contain the references to these two rulesets - again, similar to the WordPress ruleset in WPCS -. In practice, the "main" ruleset would be the same as the Extra ruleset.

There are already a number of sniffs now in the main Theme ruleset over which there is still a discussion going about whether they belong there, so splitting the ruleset into these two would solve the problem there and prevent those discussions from hindering continued development in this repo.

In practice, what I propose would result in:

Ruleset names

Regarding the names Required may not be the best name as that ruleset will also contain approved best practices and recommendations, so suggestions for better names for the rulesets would be very welcome.

For the prefix, I would suggest to keep that in-line with whatever is decided in issue #167.

Timing

This does not need to be decided upon before the de-forking from WPCS as this can be handled in a separate PR after the de-forking has been done.

I would, however, recommend deciding about this in the near future.

justintadlock commented 6 years ago

For the WPTheme-Required, maybe WPTheme-Standard?

joyously commented 5 years ago

Maybe I'm just dense, but I don't see any benefit of having multiple rulesets.

carolinan commented 5 years ago

I don't mind the idea or the naming, but these extra rules should not be a priority until "everything else" is complete.