-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support for PHP 8 with WPCS #37
Comments
No release has been made yet but a tagged version in https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/2.3.0-fix-vsprintf |
@akshitsethi I am seeing the same thing. Do you have a temporary workaround in your project to get past this? Long term solution might be to version control the |
@claytoncollie Unfortunately, I'm stuck as well atm. If you want something to be fixed locally for you, then I suggest you make the changes as done in this PR - https://github.com/WordPress/WordPress-Coding-Standards/pull/1935/files |
@akshitsethi @claytoncollie One solution would be to exclude the broken sniff from the 10up ruleset and add the updated version from that PR as a custom sniff in the 10up ruleset. |
I tried to create a branch in this repository with the tag created by Gary Jones. But since it is on the
Running the require command produces an error related to the automatic vipcs package.
I think the easiest fix is what @johnwatkins0 suggested. |
@claytoncollie your idea worked great for me after a long struggle trying other solutions. Thanks! Here's my composer.json: {
"repositories": [
{
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards"
}
],
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"wp-coding-standards/wpcs": "dev-develop#2.3.0-fix-vsprintf"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
} |
The official roadmap for WPCS v3.0, which adds support for PHP 8.0 can be read here: |
The workaround I used for this was to upgrade to PHP 8.1 (8.0 is approaching EOL in a couple months anyway) and then add the following to your phpcs.xml file: |
WPCS 3.0.0 was released on 8/21. You can either wait for this repository to be updated or you can use the composer.json example above to require the latest tag. https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.0 |
I've just tagged a You can try it out by using:
If you have any issues, please log them in #49 or open an issue and reference that PR. |
Describe the bug
There is an error when running
phpcs
with the current release ofwpcs
which isv2.3.0
. The error which occurs forPHP 8.0
only is as under:Related issues:
Steps to Reproduce
v8.0
composer lint
for any project usingphpcs-composer
packageScreenshots, screen recording, code snippet
Environment information
v8.0.26
dev-master
v2.3.0
WordPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: