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

Upgrade PHPCS standards #8724

Open
aaemnnosttv opened this issue May 16, 2024 · 1 comment
Open

Upgrade PHPCS standards #8724

aaemnnosttv opened this issue May 16, 2024 · 1 comment
Assignees
Labels
P1 Medium priority PHP Type: Infrastructure Engineering infrastructure & tooling

Comments

@aaemnnosttv
Copy link
Collaborator

Feature Description

In order to support compatibility with newer versions of PHP, we need to upgrade some of our tooling for compatibility, such as PHPCS.

WPCS recently released a long-awaited major release (v3) which adds needed compatibility with PHP 8.

Similarly, the WP VIP coding standards automattic/vipwpcs also released a new matching major version.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • wp-coding-standards/wpcs and automattic/vipwpcs should be upgraded to their latest versions
  • The PHPCS configuration should be updated as necessary to preserve compatibility with our current rules
  • Simple fixes that can be applied automatically by PHPCS should be included
    • anything requiring substantial manual updating/review should be excluded temporarily and a follow-up issue opened to address

Implementation Brief

  • Update wp-coding-standards/wpcs and automattic/vipwpcs to ^3 in composer.json and upgrade these with Composer to install the latest (including their dependencies)
  • This issue is largely about applying automatic fixes working through the failures raised and updating configuration as necessary
    • E.g. The WP core rule WordPress.PHP.DisallowShortTernary no longer exists and has been replaced by the Universal.Operators.DisallowShortTernary rule, so some reworking of the PHPCS configuration file is needed. This isn't very intuitive and can result in many more errors raised if done incorrectly.

Test Coverage

  • No changes in coverage

QA Brief

Changelog entry

@aaemnnosttv aaemnnosttv added P1 Medium priority Type: Infrastructure Engineering infrastructure & tooling PHP labels May 16, 2024
@aaemnnosttv aaemnnosttv self-assigned this May 16, 2024
@thelovekesh
Copy link

@aaemnnosttv I hope #8757 is helpful. I haven't addressed any errors aside from updating the obsolete sniff names. Please feel free to decide which sniffs you want to run on this code (report summary added in the PR description), and I can take care of the remaining fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority PHP Type: Infrastructure Engineering infrastructure & tooling
Projects
None yet
Development

No branches or pull requests

2 participants