Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer/PHPCS: update to YoastCS 3.0.0 #219

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 16, 2023

Summary

This PR can be summarized in the following changelog entry:

  • Code quality

Relevant technical choices:

Composer/PHPCS: update to YoastCS 3.0.0

YoastCS 3.0.0 has been released and is based on WordPressCS 3.0.0.

This commit makes the necessary updates for that:

  • Composer: update the requirements.
  • PHPCS ruleset:
    • Add one selective exclusion for a specific situation.
  • GHA CS workflow: run the CS check on the latest PHP version.
    No need to run on PHP 7.4 any more as the deprecations previously encountered were all fixed.

Refs:

PHPCS: minor fix to ignore annotation

When ignoring multiple sniffs/codes, the names should be comma-separated without spaces.

GH Action/cs: use the threshold/branch report

... instead of a full scan.

As there are some YoastCS 3.0 issues which still need to be solved by the teams, this changes the CS workflow to use the threshold report instead of expecting a 100% clean code base.

Milestone

  • I've attached the next release's milestone to this pull request.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • If the builds runs correctly and passes, we're good.

YoastCS 3.0.0 has been released and is based on WordPressCS 3.0.0.

This commit makes the necessary updates for that:
* Composer: update the requirements.
* PHPCS ruleset:
    - Add one selective exclusion for a specific situation.
* GHA CS workflow: run the CS check on the latest PHP version.
    No need to run on PHP 7.4 any more as the deprecations previously encountered were all fixed.

Refs:
* https://github.com/Yoast/yoastcs/releases/tag/3.0.0
* https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.0
When ignoring multiple sniffs/codes, the names should be comma-separated without spaces.
... instead of a full scan.

As there are some YoastCS 3.0 issues which still need to be solved by the teams, this changes the CS workflow to use the threshold report instead of expecting a 100% clean code base.
Copy link

composer.lock

Dev Package changes

Package Operation From To About
automattic/vipwpcs add - 3.0.0 view code - License: MIT License
phpcsstandards/phpcsextra add - 1.2.1 view code - License: GNU Lesser General Public License v3.0 or later
phpcsstandards/phpcsutils add - 1.0.9 view code - License: GNU Lesser General Public License v3.0 or later
phpstan/phpdoc-parser add - 1.24.4 view code - License: MIT License
sirbrillig/phpcs-variable-analysis add - v2.11.17 view code - License: BSD 2-Clause "Simplified" License
slevomat/coding-standard add - 8.14.1 view code - License: MIT License
squizlabs/php_codesniffer upgrade 3.7.2 3.8.0 diff
wp-coding-standards/wpcs upgrade 2.3.0 3.0.1 diff
yoast/yoastcs upgrade 2.3.1 3.0.0 diff

Settings · Docs · Powered by Private Packagist

@jrfnl jrfnl changed the title Jrf/cs/update phpcs ruleset yoastcs 3.0.0 Composer/PHPCS: update to YoastCS 3.0.0 Dec 16, 2023
@jrfnl jrfnl merged commit e333d2a into develop Dec 16, 2023
9 checks passed
@jrfnl jrfnl deleted the JRF/CS/update-phpcs-ruleset-yoastcs-3.0.0 branch December 16, 2023 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant