Skip to content

Releases: infinum/eightshift-coding-standards

3.0.1

26 Feb 08:50
47c1587

Choose a tag to compare

Changed

  • updated PHPUnit to resolve the vulnerability issue with the package

3.0.0

20 May 07:32
aaceba3

Choose a tag to compare

Changed

  • Components helpers in the new eightshift-libs@8.0.0 is deprecated and removed. Instead Helpers is used. The Eightshift.Security.ComponentsEscape sniff is updated and renamed to Eightshift.Security.HelpersEscape to reflect this change.

ES Coding Standards v2 beta

22 Sep 13:45
57719e1

Choose a tag to compare

Pre-release

Updated to WPCS v3.0.0

Still beta, as a fix that'll be in WPCS v3.1.0 is not out yet.

Thanks to @dingo-d for the update!

Update FunctionComment Sniff

05 Jul 14:22
9441a91

Choose a tag to compare

Changed

  • Add a parameter $allowedExtendedClasses in the FunctionComment sniff
    • This way we can add a list of specific extending CLI classes which won't trigger
      phpcs error on the __invoke() method.

Minor CI/CD fix

10 May 12:15
e205370

Choose a tag to compare

This release just fixes the CI/CD failures (xmllint and line width issue in one of the sniff file), no functional changes were made

1.5.0 Update

16 Mar 16:16
bbed2b2

Choose a tag to compare

Added

  • Add overriddenClass parameter for the EightShift ComponentsEscape sniff
    • This parameter will catch the cases where the libs Components class has been overridden.
  • Add ignoreComments property for the line length sniff

Fixed

  • Fixed the edge case with overwriting libs classes.

Changed

  • Code cleanup in EightShift ComponentsEscape sniff

Ruleset fix

10 Mar 12:02
cf7a49a

Choose a tag to compare

Fixed

  • Exclude the native WordPress.Security.EscapeOutput.OutputNotEscaped sniff, because we are overloading it

ComponentsEscape sniff bugfix

10 Mar 11:39
8ade500

Choose a tag to compare

Fixed

  • Fixed Eightshift.Security.ComponentsEscape sniff
    • There was a case where the next string token caused issue because there was no guard clause
      to check if the string is actually a Components class or not.

1.4.0

09 Mar 11:09
aa1a503

Choose a tag to compare

Added

  • EightShift ruleset: add rules for use statements
    • Adds a new dependency on the Slevomat Coding Standard library.
    • Adds four sniffs from this coding standard to the ruleset:
      1. Forbidding unused use statements.
      2. Enforcing fully qualified global functions and constants.
      3. Enforcing import use statements for everything else.
    • Includes fixing up the EightShift coding standards code base for these new rules.
    • Ref: https://github.com/slevomat/coding-standard
  • Add new EightShift FunctionComment sniff
    • This sniff overloads the Squiz.Commenting.FunctionComment sniff which normally comes included via the WordPress-Docs ruleset and makes an allowance for the __invoke method in the CLI classes.
    • Includes:
      • Unit tests.
      • Adjusting the ruleset to maintain the same excludes as WPCS had from the Squiz ruleset.
      • Adjusting the ruleset to maintain the previous exclude for parameter alignment.
  • Add new EightShift ComponentsEscape sniff
    • This sniff overloads the WordPress.Security.EscapeOutput.OutputNotEscaped sniff which comes included with WordPress-Extra ruleset and makes an allowance for a certain EightshiftLibs\Helpers\Components static methods (render and outputCssVariables).
  • Add @Covers tag for all the tests
  • Add the documentation for the new sniffs

Changed

  • PHPCS ruleset: tabs not spaces
  • PHPCS: simplify ruleset
  • Composer
  • Update composer to add the allow-plugins
  • Update disallow do_shortcode sniff
    • The sniff is updated so that it extends the WPCS Sniff class. This class has two super useful helpers: is_token_namespaced and is_class_object_call. They allow super quick checks for namespaced functions and static functions named do_shortcode which would otherwise trigger a false positive result.
  • Update GitHub Actions Workflow update
    • Update composer install action to v2.
    • Add concurrency check to save resources.
  • Update minimum PHP version to 7.4 and tab width in the ruleset to 4

Removed

  • Composer
    • Remove the Composer PHPCS plugin dependency as it already is a dependency of both PHPCSExtra as well as SlevomatCodingStandards, so we'll inherit it anyway.

Fixed

  • Fix the wrong namespace in the ruleset
  • PHPCS: improve PHPCompatibility check for this repo
    • Remove the dependency as it is already a dependency of PHPCompatibilityWP and having both may cause version conflicts later.
    • Reset the severity of all PHPCompatibility sniffs to 5 for scanning the EightShiftCS code itself as that code is run outside the context of WordPress.

A huge thanks to Juliette Reinders Folmer (@jrfnl) for amazing help in fixing tons of issues with the ruleset and sniffs.

1.3.0

04 May 15:41
0ebb751

Choose a tag to compare

Removed

  • Modified escaping sniff
    • The sniff wasn't working correctly, and we'll wait for the upstream to fix the issue
  • Exclude doc comment align sniff

Fixed

  • Improve disallow do shortcode sniff (better regex and tests)
  • Fixed the namespace in the ruleset.xml

Changed

  • Update minimum supported WP version to 5.4