#53477 closed task (blessed) (fixed)
Composer: update PHP_CodeSniffer
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | commit has-patch |
Focuses: | coding-standards | Cc: |
Description
The latest PHP_CodeSniffer release is 3.6.0 from April this year.
Based on the composer.lock
file, however, WP is still using PHPCS 3.5.5 (April 2020).
I'd like to recommend an update as the releases since PHPCS 3.5.5 contain various bugfixes which may benefit WP, as well as (nearly complete) support for everything PHP 8.0, though, for now, I'd still recommend running PHPCS on PHP 7.4 in CI.
Relevant changelogs:
- https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.6
- https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.7
- https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.6.0
To update, a patch is needed which:
- Updates the
composer.json
andcomposer.lock
files. - Verifies whether any exclusions made in the custom ruleset which were related to PHPCS bugs can be removed (and if applicable, removes them).
- Verifies whether any inline
phpcs:ignore
annotations which were related to PHPCS bugs can be removed (and if applicable, removes them). - If necessary, selectively fixes newly flagged errors, which can happen when a "false negative" bug in PHPCS has been fixed.
Attachments (1)
Change History (7)
#1
@
3 years ago
- Keywords commit has-patch added; needs-patch removed
All four tasks have been executed and only the composer.lock
file needs an update.
See GH PR https://github.com/WordPress/wordpress-develop/pull/1510 for a passing build.
I did come across a few stray ignore annotations during the review, but those were not related to the PHPCS update, so the patches for those have been added to the WP 5.9 CS ticket #53359.
This ticket was mentioned in PR #1510 on WordPress/wordpress-develop by jrfnl.
3 years ago
#2
Update the PHP_CodeSniffer dependency from version 3.5.5 to version 3.6.0.
Trac ticket: https://core.trac.wordpress.org/ticket/53477
I have also verified the ignore annotations, but no changes are needed there which are directly related to the PHPCS update. Changes which could be made have been added to #53359.
3 years ago
#5
Closing as merged via changeset https://core.trac.wordpress.org/changeset/51470
Update PHPCS to version 3.6.0, no new violations flagged.