phpcs-composer icon indicating copy to clipboard operation
phpcs-composer copied to clipboard

3.0.0 fails with ERROR: Referenced sniff "WordPress.WP.TimezoneChange.DeprecatedSniff" does not exist.

Open benlk opened this issue 4 months ago • 1 comments

Describe the bug

Installed according to instructions in README.md, in a non-10up WordPress plugin to audit it. (https://wordpress.org/plugins/fix-alt-text/)

/wp-content/plugins/fix-alt-text$ composer run lint
> phpcs .
ERROR: Referenced sniff "WordPress.WP.TimezoneChange.DeprecatedSniff" does not exist.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.Window sniff is listening for JS.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.DangerouslySetInnerHTML sniff is listening for JS.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.InnerHTML sniff is listening for JS.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.StrippingTags sniff is listening for JS.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.StringConcat sniff is listening for JS.
DEPRECATED: Scanning CSS/JS files is deprecated and support will be removed in PHP_CodeSniffer 4.0.
The WordPressVIPMinimum.JS.HTMLExecutingFunctions sniff is listening for JS.

Run "phpcs --help" for usage information

Script phpcs . handling the lint event returned with error code 3

Steps to Reproduce

See above.

Screenshots, screen recording, code snippet

No response

Environment information

  • PHP 8.2
  • composer 2.8.6
  • phpcs 3.13.2
  • WordPress 6.8.2
  • Local WP

WordPress information

Stock WordPress, plus VIP GO mu-plugins from https://github.com/Automattic/vip-go-mu-plugins-built/

This shouldn't be relevant because we're not executing WordPress at this time.

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

benlk avatar Aug 27 '25 16:08 benlk

After patching that one test out with phpcs.xml, the test runs to completion.

<ruleset name="Fix Alt Text">
    <rule ref="10up-Default">
        <exclude name="WordPress.WP.TimezoneChange.DeprecatedSniff"/>
    </rule>
</ruleset>

benlk avatar Aug 27 '25 16:08 benlk