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 #373

Merged
merged 2 commits into from
Dec 16, 2023

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 16, 2023

Context

  • CI/QA update introducing YoastCS 3.0

Summary

This PR can be summarized in the following changelog entry:

  • CI/QA update introducing YoastCS 3.0

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:
    • Enforce strict PSR-4 for the tests.
    • Remove some configuration which is now handled by YoastCS.
    • Remove a few exclusions which are no longer needed.
  • 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:

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.

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 build 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:
    - Enforce strict PSR-4 for the tests.
    - Remove some configuration which is now handled by YoastCS.
    - Remove a few exclusions which are no longer needed.
* 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
... 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.
@jrfnl jrfnl added yoast cs/qa changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Dec 16, 2023
@jrfnl jrfnl added this to the 3.2 milestone Dec 16, 2023
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

Important Metadata Changes

Package Version Metadata From To
squizlabs/php_codesniffer 3.8.0 dist url https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879 https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7
squizlabs/php_codesniffer 3.8.0 source url https://github.com/squizlabs/PHP_CodeSniffer.git https://github.com/PHPCSStandards/PHP_CodeSniffer.git

Settings · Docs · Powered by Private Packagist

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7229516704

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 57.143%

Totals Coverage Status
Change from base Build 7229486252: 0.0%
Covered Lines: 172
Relevant Lines: 301

💛 - Coveralls

@jrfnl jrfnl merged commit 1844f3a into develop Dec 16, 2023
16 checks passed
@jrfnl jrfnl deleted the JRF/CS/update-phpcs-ruleset-yoastcs-3.0.0 branch December 16, 2023 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog yoast cs/qa
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants