[wp-trac] [WordPress Trac] #59161: Composer: update to WordPressCS 3.0.0

WordPress Trac noreply at wordpress.org
Tue Sep 26 00:24:59 UTC 2023


#59161: Composer: update to WordPressCS 3.0.0
------------------------------+-------------------------------
 Reporter:  jrf               |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  6.4
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:  coding-standards
------------------------------+-------------------------------

Comment (by SergeyBiryukov):

 In [changeset:"56695" 56695]:
 {{{
 #!CommitTicketReference repository="" revision="56695"
 Coding Standards: Upgrade WPCS to version 3.0.0.

 This is an important release which makes significant changes to improve
 the accuracy, performance, stability and maintainability of all sniffs, as
 well as making WordPressCS much better at handling modern PHP.

 WordPressCS 3.0.0 contains breaking changes, both for people using ignore
 annotations, people maintaining custom rulesets, as well as for sniff
 developers who maintain a custom PHPCS standard based on WordPressCS.

 If you are an end-user or maintain a custom WordPressCS based ruleset,
 please start by reading the [https://github.com/WordPress/WordPress-
 Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-ruleset-
 maintainers Upgrade Guide to WordPressCS 3.0.0 for ruleset maintainers]
 which lists the most important changes and contains a step by step guide
 for upgrading.

 If you are a maintainer of an external standard based on WordPressCS and
 any of your custom sniffs are based on or extend WordPressCS sniffs,
 please read the [https://github.com/WordPress/WordPress-Coding-
 Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-
 external-standards Upgrade Guide to WordPressCS 3.0.0 for Developers].

 In all cases, please read the complete changelog carefully before you
 upgrade.

 This commit:
 * Updates the Composer dependencies to use the new version, including
 updating the underlying PHP_CodeSniffer dependency to the new minimum
 supported version for WPCS.[[BR]] Note: the Composer PHPCS installer
 plugin is no longer explicitly required as it is now a dependency of WPCS,
 so the dependency is inherited automatically.
 * Updates the ruleset for WPCS 3.0.0. This includes:
  * Raising the memory limit to be on the safe side as WPCS 3.0.0 contains
 a lot more sniffs.
  * Removing explicit inclusions of extra rules, which have now been added
 to the `WordPress-Core` ruleset..
  * Updating property names for select sniffs.
  * Updating one exclusion — the
 `WordPress.CodeAnalysis.AssignmentInCondition` sniff has been (partially)
 replaced by the `Generic.CodeAnalysis.AssignmentInCondition` sniff.
  * Adding one new exclusion.
 * Downgrades one new error to a warning.[[BR]] The
 `Generic.Files.OneObjectStructurePerFile` sniff enforces that there is
 only one OO structure declaration per file. At this time, this sniff would
 yield 29 errors. By downgrading the sniff to a ''warning'', the build can
 pass and the issues can be fixed in due time. For now, the test directory
 will be excluded until the issues are fixed (as the test directory CS run
 does not allow for warnings).
 * Updates ignore annotations for WPCS 3.0.0.

 Reference: [https://github.com/WordPress/WordPress-Coding-
 Standards/releases/tag/3.0.0 WPCS 3.0.0 release notes].

 Follow-up to [43571], [44574], [45600], [47927].

 Props jrf, jorbin, desrosj.
 See #59161.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59161#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list