Use plugin-check GitHub workflow in favor of brittle plugin-check PHPCS checks#139
Use plugin-check GitHub workflow in favor of brittle plugin-check PHPCS checks#139
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.
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.
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.
+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.
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.
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 |
justlevine
left a comment
There was a problem hiding this comment.
Once plugin-check-action is pinned, LGTM 🚀
Co-authored-by: Dovid Levine <justlevine@gmail.com>
Port changes from WordPress/ai#139 to transition from the local wpackagist-plugin/plugin-check dependency to the official wordpress/plugin-check-action GitHub Action. - Add .github/workflows/plugin-check.yml. - Remove wpackagist-plugin/plugin-check from composer.json. - Remove related rules from tools/phpcs/phpcs.ruleset.xml. - Add PHPCS exclusion for object-cache.copy.php filename to allow drop-in naming. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Port changes from WordPress/ai#139 to transition from the local wpackagist-plugin/plugin-check dependency to the official wordpress/plugin-check-action GitHub Action. - Add .github/workflows/plugin-check.yml. - Remove wpackagist-plugin/plugin-check from composer.json. - Remove related rules from tools/phpcs/phpcs.ruleset.xml. - Add PHPCS exclusion for object-cache.copy.php filename to allow drop-in naming. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: felixarntz <flixos90@git.wordpress.org> Co-authored-by: JasonTheAdams <jason_the_adams@git.wordpress.org> Co-authored-by: justlevine <justlevine@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
See WordPress/ai#139 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.