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

ERROR: Referenced sniff "Universal.NamingConventions.NoReservedKeywordParameterNames" does not exist #2435

Closed
picard102 opened this issue Mar 20, 2024 · 2 comments

Comments

@picard102
Copy link

picard102 commented Mar 20, 2024

Hitting this error whenever I run phpcs.

PHPCS is installed via Brew.

% phpcs --standard=WordPress --report=verbose /Users/johnleschinski/Sites/awards/src/404.php
ERROR: Referenced sniff "Universal.NamingConventions.NoReservedKeywordParameterNames" does not exist

Run "phpcs --help" for usage information
 $phpCodeSnifferConfig = array (
  'installed_paths' => '/Users/username/.composer/vendor/wp-coding-standards/wpcs,/Users/username/.composer/vendor/phpcsstandards/phpcsutils',
  'default_standard' => 'WordPress',
);

@jrfnl
Copy link
Member

jrfnl commented Mar 20, 2024

Please read the upgrade guide for WordPressCS 3.0.0.

While installing WordPressCS without Composer is still possible, no support will be given anymore for such installs.

@picard102
Copy link
Author

For anyone who's looking for a fix while not changing their whole setup.
I had to add the phpcsextra path to the installed_paths.
You can find the file to edit by using phpcs --config-show, which in my case was /opt/homebrew/Cellar/php-code-sniffer/3.9.0/bin/CodeSniffer.conf

You can also do it via phpcs --config-set installed_paths YOURPATH/wp-coding-standards/wpcs/Wordpress,YOURPATH/composer/vendor/phpcsstandards/phpcsutils,YOURPATH/composer/vendor/phpcsstandards/phpcsextra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants