-
-
Couldn't load subscription status.
- Fork 523
Description
Work on WordPressCS 3.0.0 will start in the near future. @GaryJones, @dingo-d and me have recently had a call to discuss what we envision for WPCS 3.0.0.
This issue is intended to keep track of what needs to be done, as well as give openness about the changes envisioned for WPCS 3.0.0.
Milestone: https://github.com/WordPress/WordPress-Coding-Standards/milestone/25
Planning:
- Ready when it's ready.
- Most of the initial PRs are tentatively expected in the
second half of April/beginning of May (2020)July 2020. - There will be at least one release candidate before the actual release of WPCS 3.0.0.
Environment changes:
- The minimum PHPCS requirement will go up to - at least - PHPCS 3.5.0.
- WPCS will get two (three) new dependencies:
- PHPCSUtils - a set of utility functions and other helpers for sniff writers
- PHPCSExtra - a set of generic sniffs
- The DealerDirect Composer PHPCS plugin - this is a dependency of the above two packages, so we will automatically benefit from it.
- The installation instructions will change.
- A Composer based project/global install will be the recommended and only supported manner of installation.
- Stand-alone installation from a downloaded zip file, using a git clone or using
composer create-projectwill still be possible, but no support will be given for those installations.
Note: PHPCSUtils and PHPCSExtra both are on 1.0.0-alphaX releases at the time of writing this.
The first stable 1.0.0 for both will be tagged before the first WPCS 3.0.0 RC will be (pre-)released.
Roadmap / what needs to be done:
- Update the environment files (
composer.json,.travis.ymletc) to allow the changes to be made. - PR 3.0: Composer: set the new requirements for WPCS #1905 - Remove all previously deprecated code - WPCS 3.0: Remove the deprecated Sniff::has_whitelist_comment() method #1583, WPCS 3.0.0: Remove deprecated WP.TimezoneChange sniff #1819 - PRs 3.0: Remove deprecated
Sniff::has_whitelist_comment()method and all references to it #1908, 3.0: Remove the WordPress.WP.TimezoneChange sniff #1909 - Remove all sniffs which can be replaced by upstream sniffs now the minimum PHPCS version has been upped (if any) and add the PHPCS native sniff to the ruleset(s) instead. - PR 3.0: Replace the
WordPress.CodeAnalysis.EmptyStatementsniff #1910 - Remove all sniffs which can be replaced by sniffs in the PHPCSExtra standard and add the PHPCSExtra sniff to the ruleset(s) instead. - PR 3.0: Replace the
WordPress.PHP.DisallowShortTernarysniff #1911, 3.0: Replace theWordPress.WhiteSpace.DisallowInlineTabssniff #1912, 3.0: Replace theWordPress.PHP.StrictComparisonssniff #1919, 3.0: Core: replaceGeneric.Arrays.DisallowShortArraySyntaxwithUniversalversion #1920 (more to come) - Remove all WPCS native utility methods which can be replaced by utility methods from PHPCSUtils and adjust the function calls to these methods in individual sniffs. Part 1: PR 3.0: Remove the PHPCSHelper class #1922, Part 2: PR 3.0: Remove some utility methods from the Sniff class #1926
- Review every individual sniff for opportunities to simplify the code and/or fix "modern PHP" bugs by using utilities from PHPCSUtils.
Where applicable, add extra unit tests to the sniff to demonstrate bugs fixed and safeguard this for the future.
See the checklist in the comment below for status - Once available, switch over to using the Class/Function/FunctionParam abstracts from PHPCSUtils for all sniffs using the WPCS native abstracts for these type of sniffs. (expected partially in PHPCSUtils alpha 3, partially in alpha 4).
- Once all sniffs using a particular type of WPCS native abstract sniff have been switched over, remove the WPCS native version of that abstract sniff.
- Of the remaining utility methods/properties in the WPCS native
Sniffclass: aside from generically useful methods, move most methods and properties to traits which target something specific. Also see Extract re-usable code from Sniff.php into new package #1465 (@jrfnl) - If any WPCS sniffs extend another sniff, while the other sniff is also included in one of the WPCS rulesets, split the logic being re-used off into a trait and let the sniffs use the trait, instead of one sniff extending another as this is known to be buggy with the PHPCS autoloader.
- Go through the Make blog post and find relevant sniffs to add. (@jrfnl)
- For those things in the Make blog post for which there are no existing sniffs in either PHPCS itself or PHPCSExtra, open an issue to create this sniff.
Generically usable sniffs should be added to PHPCSExtra, WP or WPCS specific sniffs should be added to WPCS itself.
Note: these do not all need to be addressed in WPCS 3.0.0. Additional sniffs can be added in minors, so some issues may be left to address later. - Go through the 3.0.0 milestone and address what else needs addressing.
- Go through the open issues to see if there are any issues which can now be more easily addressed with the utilities from PHPCSUtils and either send in a PR or milestone the issue for a later 3.x release.
- Go through the open PRs, especially the ones which have been abandoned, and either update them to make them mergable if the author is no longer responding or close them.
- Review the rulesets for any other sniffs replacements/tweaks which can/should be made.
- Update the README and the CONTRIBUTING files for the new reality.
- Write an "Upgrade Guide" for external standards which use(d) the utilities in WPCS to be added to the wiki.
- Create the changelog ;-)
I've tried to be complete here, but please feel free to leave comments about anything I've forgotten in this list ;-)