Releases: infinum/eightshift-coding-standards
Releases · infinum/eightshift-coding-standards
3.0.1
3.0.0
ES Coding Standards v2 beta
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
Changed
- Add a parameter
$allowedExtendedClassesin 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.
- This way we can add a list of specific extending CLI classes which won't trigger
Minor CI/CD fix
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
Added
- Add
overriddenClassparameter 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
Fixed
- Exclude the native
WordPress.Security.EscapeOutput.OutputNotEscapedsniff, because we are overloading it
ComponentsEscape sniff bugfix
Fixed
- Fixed
Eightshift.Security.ComponentsEscapesniff- 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.
- There was a case where the next string token caused issue because there was no guard clause
1.4.0
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:
- Forbidding unused
usestatements. - Enforcing fully qualified global functions and constants.
- Enforcing import
usestatements for everything else.
- Forbidding unused
- 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.FunctionCommentsniff which normally comes included via theWordPress-Docsruleset and makes an allowance for the__invokemethod in the CLI classes. - Includes:
- Unit tests.
- Adjusting the ruleset to maintain the same excludes as WPCS had from the
Squizruleset. - Adjusting the ruleset to maintain the previous exclude for parameter alignment.
- This sniff overloads the
- Add new EightShift ComponentsEscape sniff
- This sniff overloads the
WordPress.Security.EscapeOutput.OutputNotEscapedsniff which comes included withWordPress-Extraruleset and makes an allowance for a certainEightshiftLibs\Helpers\Componentsstatic methods (renderandoutputCssVariables).
- This sniff overloads the
- 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 the PHP Parallel Lint version constraint for improved compatibility with PHP 8.1.
- 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
- The ruleset namespace was wrongly set. For correct usage refer to this link: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Version-3.0-Upgrade-Guide, and for the full explanation watch the workshop video :).
- 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
5for 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
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