-
Notifications
You must be signed in to change notification settings - Fork 29
Use plugin-check GitHub workflow in favor of brittle plugin-check PHPCS checks #139
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
base: develop
Are you sure you want to change the base?
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@felixarntz I originally took this pattern from wordpress/performance (where it looks like @westonruter is currently battling the same issue in WordPress/performance#2257 ). What (if any) are the practical implications of this change to detection? Should this be the defacto pattern for the Performance plugin too, all canonical plugins, or at least our other core-ai repos? |
| "require-dev": { | ||
| "automattic/vipwpcs": "^3.0", | ||
| "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", | ||
| "phpcompatibility/php-compatibility": "10.x-dev as 9.99.99", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd assume we'd just be changing this to "^10.0.0-alpha," why remove it entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK we don't even need the aliasing anymore:
This works just fine for me:
"phpcompatibility/php-compatibility": "^10.0.0-alpha",
"phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha",There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I don't think we should do the aliasing, that feels quite hacky. We need to ensure our dependencies are compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is fine by me as well, though noting it's not much different than the aliasing approach we have now (still ends up pulling in dev releases). I think the important piece here that we don't have now is the "phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha", as without that I think the automattic/vipwpcs package will complain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed this in 0e3d827: We should only need to include "phpcompatibility/phpcompatibility-wp" because we don't use "phpcompatibility/php-compatibility" anywhere explicitly, in other words, it's an indirect dependency - no need to specify it.
By requiring "phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha", "phpcompatibility/php-compatibility": "^10.0.0-alpha" will be installed anyway.
Indeed! I was also thinking of switching to using the PCP action. Nevertheless, I've also opened WordPress/plugin-check#966 so that hopefully the sniffs from PCP can be more elegantly added to existing PHPCS rulesets without the redundancy of running PCP. |
I'm not sure I understand your question, can you elaborate? "change to detection" of what? There are two reasons I opened this PR:
|
Sorry, yeah that was horrible phrasing. (Depending on the answer, we might want to e.g. pin |
I answered something like that in #138 (comment): The PHPCS sniffs from Plugin Check are only a subset of what Plugin Check checks.
I think including sniffs from Plugin Check is always going to be problematic because it's a plugin, not a proper package with |
Fixes #138.
Relevant technical choices
plugin-checkplugin inclusion just to use its PHPCS rules. That approach leads to problems because of including a plugin that itself depends on other PHPCS foundational pieces, without being able to declare that (since it's a plugin served fromwpackagist, so it can't express its own dependencies properly).plugin-check.ymlGitHub workflow that useswordpress/plugin-check-actionto run the full Plugin Check scanner. In addition to fixing the issue, it is more comprehensive.Test using WordPress Playground
The changes in this pull request can be previewed and tested using this WordPress Playground instance:
Click here to test this pull request.