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

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:
    • Update a few sniff/property names for new names in WordPressCS 3.0.
    • Enforce strict PSR-4 for the tests.
    • Add configuration for the new WordPress.WP.Capabilities sniff.
    • Remove a few exclusions which are no longer needed.
    • Add a few selective exclusions for specific situations.
  • 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:
    - Update a few sniff/property names for new names in WordPressCS 3.0.
    - Enforce strict PSR-4 for the tests.
    - Add configuration for the new `WordPress.WP.Capabilities` sniff.
    - Remove a few exclusions which are no longer needed.
    - Add a few selective exclusions for specific situations.
* 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 this to the 4.6 milestone Dec 16, 2023
@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
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7229346582

  • 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 50.203%

Totals Coverage Status
Change from base Build 7229298252: 0.0%
Covered Lines: 1236
Relevant Lines: 2462

💛 - Coveralls

@jrfnl jrfnl merged commit 79410f9 into trunk Dec 16, 2023
23 checks passed
@jrfnl jrfnl deleted the JRF/CS/update-phpcs-ruleset-yoastcs-3.0.0 branch December 16, 2023 02:56
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.

2 participants