Skip to content

v2.0.0

Compare
Choose a tag to compare
@jaymcp jaymcp released this 13 Nov 16:49
· 23 commits to main since this release
29bd13c

This release requires WPCS 3.0.0 and VIP WPCS 3.0.0, and contains breaking changes.

Changelog

  • Modify the ruleset's PHPCS ruleset to use the ruleset included in WPCS v3.0.0
  • Upgrade and reorganise dependencies to reflect changes introduced in WPCS v3.0.0
  • Upgrade BigBite.Files.FileName sniff to reflect changes introduced in WPCS v3.0.0
  • Skip output of BigBite.Files.FileName.NotHyphenatedLowercase error if covered by other error codes (fixes #96)
  • Introduce several new sniffs - see "Sniff changes" below
  • Fixes #119

Sniff changes

For the full list of upstream changes, see the WPCS release notes and VIP WPCS release notes

We have also introduced several new sniffs that have been made available as a result of the incredible work of the WPCS team:

Universal.FunctionDeclarations.NoLongClosures
Detects "long" closures and recommends using a named function instead.
Configured to warn at 5 lines and error at 8 lines.
This has potential to cause new errors in your projects if you heavily utilise closures.
This is a good thing, because long closures have always been discouraged by our style guide in a WordPress context.

Universal.FunctionDeclarations.RequireFinalMethodsInTraits
Enforces qualified methods (i.e. not abstract) in traits to be declared as final when such methods are not declared as private.

Universal.Operators.DisallowLogicalAndOr
Enforces the use of boolean operators (&&, ||) instead of logical operators (and, or).

Known breaking changes

Universal.NamingConventions.NoReservedKeywordParameterNames
A new upstream sniff which disallows use of "reserved" keywords as function parameter names ($list, $class`, etc.).

Universal.FunctionDeclarations.NoLongClosures
A new sniff which disallows the use of "long" closures, in favour of named functions.

Universal.UseStatements.NoUselessAliases
Disallows renaming of imports where there is no collision (use Foo\Bar\Baz as Qux).