Yoast / yoastcs

Yoast coding standards
MIT License
21 stars 3 forks source link

[3.0.0] Sniff wish list #303

Open jrfnl opened 1 year ago

jrfnl commented 1 year ago

@diedexx, @enricobattocchi and me have had a brainstorm session in the office this week to validate previously made decisions about code style and best practices and to come up with a list of things we'd like to start enforcing now support for PHP < 7.2 has been dropped in the plugins.

IMG_4738

The below is (very long) list of things which were approved during this meeting.

Not everything is "sniffable" and even when it is, some things require new sniffs to be written, so it may be (quite) a while before everything in this list has been actioned.

All in all, this ticket is a mix of an action list and a way to keep track of the decisions taken, even if not all of those can be enforced yet.

Planning

Work on YoastCS 3.0.0 will start after WordPressCS 3.0.0 has been released.

Those action items which can be actioned straight away will be included in YoastCS 3.0.0.

Everything else can be included in YoastCS 3.0.0 if available by then, or in later releases when prerequisites have been fulfilled.

Also see the older YoastCS 3.0.0 roadmap ticket.

Impact

A reasonable number of new rules are in the background already being enforced. For others, a significant amount of work will need to be done to clean up the code bases to comply.

We are fully aware of this and this work will be done over time.

The Free, Premium, Local and Video plugins currently already use a threshold mechanism and those threshold will initially be raised to allow for the new violations until they have been fixed up.

For the other plugins, it will be decided on a case by case basis whether they will be cleaned up in one go or whether the threshold mechanism will be added to these for the time being.

The list

Names in square brackets after a rule indicate the package a sniff exist in or should be added to.

No action needed

The following looks to already been included in WPCS since a long time:

The following looks to have already been activated in YoastCS 2.2.0:

Sniffs covering the below rules have been included in WPCS 3.0 (and this wasn't necessarily clear yet at the time this list was made).

Non-sniff actions needed

Rules for which sniffs are already available and which will be included in YoastCS 3.0

Rules for which a sniff would need to be written

Rules which cannot be enforced via sniffs in the near future (or ever), but which have manual tasks attached which should be actioned

Rules which need further investigation

jrfnl commented 1 year ago

During the hackathon, the suggestion was raised by multiple people to rename the "integration-tests" directories to something more representative of what's inside. I fully concur and propose to call those "wp-unit-tests". I suggest we do this directory rename at the same time as the namespacing and PSR4 naming of those tests.

jrfnl commented 10 months ago

I'm going to leave this ticket open for now and move it out of the 3.0 milestone.

A significant number of the action items here have been actioned and can be considered fixed with the release of YoastCS 3.0.

However, there is still more to be done and this ticket contains lots of information about future scope action items too.