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
Update WPCS to v3.0, and fix all reported Coding Standards issues #53866
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-supports/border.php ❔ lib/block-supports/elements.php ❔ lib/block-supports/layout.php ❔ lib/block-supports/typography.php ❔ lib/blocks.php ❔ lib/class-wp-duotone-gutenberg.php ❔ lib/class-wp-theme-json-data-gutenberg.php ❔ lib/class-wp-theme-json-gutenberg.php ❔ lib/class-wp-theme-json-resolver-gutenberg.php ❔ lib/compat/wordpress-6.3/blocks.php ❔ lib/compat/wordpress-6.3/class-gutenberg-navigation-fallback.php ❔ lib/compat/wordpress-6.3/html-api/class-gutenberg-html-tag-processor-6-3.php ❔ lib/compat/wordpress-6.3/rest-api.php ❔ lib/compat/wordpress-6.3/script-loader.php ❔ lib/compat/wordpress-6.4/fonts/fonts.php ❔ lib/compat/wordpress-6.4/script-loader.php ❔ lib/experimental/block-hooks.php ❔ lib/experimental/blocks.php ❔ lib/experimental/class-wp-rest-customizer-nonces.php ❔ lib/experimental/fonts-api/bc-layer/class-wp-web-fonts.php ❔ lib/experimental/fonts-api/class-wp-fonts.php ❔ lib/experimental/fonts-api/fonts-api.php ❔ lib/experimental/fonts/font-library/class-wp-font-family.php ❔ lib/experimental/interactivity-api/class-wp-directive-context.php ❔ lib/experimental/interactivity-api/class-wp-directive-processor.php ❔ lib/experimental/interactivity-api/class-wp-interactivity-store.php ❔ lib/experimental/interactivity-api/directive-processing.php ❔ lib/experimental/kses.php ❔ lib/experimental/navigation-theme-opt-in.php ❔ phpunit/blocks/render-block-navigation-submenu-test.php ❔ phpunit/blocks/render-block-navigation-test.php ❔ phpunit/blocks/render-comment-template-test.php ❔ phpunit/blocks/render-post-template-test.php ❔ phpunit/class-block-context-test.php ❔ phpunit/class-block-library-navigation-link-test.php ❔ phpunit/class-gutenberg-navigation-fallback-gutenberg-test.php ❔ phpunit/class-gutenberg-rest-navigation-fallback-controller-test.php ❔ phpunit/class-phpunit-environment-setup-test.php ❔ phpunit/class-wp-theme-json-resolver-test.php ❔ phpunit/class-wp-theme-json-test.php ❔ phpunit/experimental/interactivity-api/directive-processing-test.php ❔ phpunit/experimental/interactivity-api/directives/wp-context-test.php ❔ phpunit/l10n-test.php ❔ phpunit/tests/fonts-api/base.php ❔ phpunit/tests/fonts-api/wpFonts/add.php ❔ phpunit/tests/fonts-api/wpFonts/addFontFamily.php ❔ phpunit/tests/fonts-api/wpFonts/doItem.php ❔ phpunit/tests/fonts-api/wpFonts/doItems.php ❔ phpunit/tests/fonts-api/wpFonts/registerProvider.php ❔ phpunit/tests/fonts-api/wpFontsResolver/registerFontsFromThemeJson.php ❔ phpunit/tests/fonts-api/wpRegisterFontProvider.php ❔ phpunit/tests/fonts/font-face/base.php ❔ phpunit/tests/fonts/font-library/wpFontLibrary/getFontCollection.php ❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/getFontCollection.php ❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/getFontCollections.php ❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/installFonts.php ❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/registerRoutes.php ❔ phpunit/tests/fonts/font-library/wpRestFontLibraryController/uninstallFonts.php |
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.
Hi @aristath Thanks for setting this up! Looking good. Just left a few remarks inline for you to consider.
lib/compat/wordpress-6.2/html-api/class-wp-html-tag-processor.php
Outdated
Show resolved
Hide resolved
lib/compat/wordpress-6.3/html-api/class-gutenberg-html-tag-processor-6-3.php
Outdated
Show resolved
Hide resolved
phpunit/experimental/interactivity-api/directive-processing-test.php
Outdated
Show resolved
Hide resolved
Flaky tests detected in b0b94b3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6168767791
|
6d93d79
to
8deef71
Compare
…st.php Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
@aristath sorry I didn't catch this before it was merged. for HTML API code this is pulled from Core, so changes need to happen first in Core and then be pulled into Gutenberg. second, the change from a I'd like to revert the HTML API changes from here if it's okay with you and then work backwards from Core. can you create a patch/Trac ticket in Core to address the issues you have? in the meantime I'd like to revert so that we don't start maintaining two separate copies of this code. |
Pulling over work on the HTML API from Core: - bug fixes for parsing inside of STYLE, IFRAME, and other RAWTEXT elements. - bug fix when document ends in the middle of processing a tag. - reverts changes made in #53866 which introduced a bug during a styling refactor
Pulling over work on the HTML API from Core: - bug fixes for parsing inside of STYLE, IFRAME, and other RAWTEXT elements. - bug fix when document ends in the middle of processing a tag. - reverts changes made in #53866 which introduced a bug during a styling refactor - stop processing in the HTML Processor when encountering unsupported markup - update docblock comments through HTML API
Pulling over work on the HTML API from Core: - bug fixes for parsing inside of STYLE, IFRAME, and other RAWTEXT elements. - bug fix when document ends in the middle of processing a tag. - reverts changes made in #53866 which introduced a bug during a styling refactor - stop processing in the HTML Processor when encountering unsupported markup - update docblock comments through HTML API
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
Of course, we can revert the changes to the HTML API in Gutenberg. |
@aristath unfortunately not, and the two repos have different style preferences, so again, unfortunately, we now have divergent code in Core and Gutenberg and it's quite a mess. some of the changed introduced here have been applied to currently I'm unable to revert without overriding the CI job because it's rejecting the change on style preferences, which is unfortunate, because it's enforcing that bug 🙃 I've mentioned you on #54481 where I'm trying to sort it all out, but admittedly, it's very confusing. |
Pulling over work on the HTML API from Core: - bug fix: stop parsing tags inside of STYLE, IFRAME, and other RAWTEXT elements. - bug fix: stay on track when document ends in the middle of processing a tag. - bug fix: remove all copies of an attribute when duplicates exist on a tag. - bug fix: stop processing in the HTML Processor when encountering unsupported markup - reverts changes made in #53866 which introduced a bug during a styling refactor. - update docblock comments through HTML API. This patch also excludes the HTML API folders in the compatability layer from WPCS inspection, since this code is maintained, reviewed, and accepted into Core and brought back into Gutenberg. Changes to the code need to be made first in Core and brought over as blessed backport changes. Co-authored-by: Ari Stathopoulos <aristath@gmail.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
Pulling over work on the HTML API from Core: - bug fix: stop parsing tags inside of STYLE, IFRAME, and other RAWTEXT elements. - bug fix: stay on track when document ends in the middle of processing a tag. - bug fix: remove all copies of an attribute when duplicates exist on a tag. - bug fix: stop processing in the HTML Processor when encountering unsupported markup - reverts changes made in #53866 which introduced a bug during a styling refactor. - update docblock comments through HTML API. This patch also excludes the HTML API folders in the compatability layer from WPCS inspection, since this code is maintained, reviewed, and accepted into Core and brought back into Gutenberg. Changes to the code need to be made first in Core and brought over as blessed backport changes. Co-authored-by: Ari Stathopoulos <aristath@gmail.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
Now that the `block-library` package is updated for WP 6.4, this is no longer necessary. Related PR from Gutenberg repository: * [WordPress/gutenberg#53866 #53866 Update WPCS to v3.0, and fix all reported Coding Standards issues] Follow-up to [56695], [56710]. See #59161. git-svn-id: https://develop.svn.wordpress.org/trunk@56741 602fd350-edb4-49c9-b593-d223f7449a82
Now that the `block-library` package is updated for WP 6.4, this is no longer necessary. Related PR from Gutenberg repository: * [WordPress/gutenberg#53866 #53866 Update WPCS to v3.0, and fix all reported Coding Standards issues] Follow-up to [56695], [56710]. See #59161. Built from https://develop.svn.wordpress.org/trunk@56741 git-svn-id: http://core.svn.wordpress.org/trunk@56253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Now that the `block-library` package is updated for WP 6.4, this is no longer necessary. Related PR from Gutenberg repository: * [WordPress/gutenberg#53866 #53866 Update WPCS to v3.0, and fix all reported Coding Standards issues] Follow-up to [56695], [56710]. See #59161. Built from https://develop.svn.wordpress.org/trunk@56741 git-svn-id: https://core.svn.wordpress.org/trunk@56253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Now that the `block-library` package is updated for WP 6.4, this is no longer necessary. Related PR from Gutenberg repository: * [WordPress/gutenberg#53866 #53866 Update WPCS to v3.0, and fix all reported Coding Standards issues] Follow-up to [56695], [56710]. See #59161. git-svn-id: https://develop.svn.wordpress.org/trunk@56741 602fd350-edb4-49c9-b593-d223f7449a82
What?
Updates WPCS to v3.0
Why?
A few days ago v3.0.0 of the WPCS package was released by @jrfnl.
More details about the package and v3.0 can be found on the post on https://make.wordpress.org/core/2023/08/21/wordpresscs-3-0-0-is-now-available/
Updating the package will ensure that Gutenberg is compatible with PHP versions greater than 8.x, and enforces stricter rules for consistency.
How?
phpcbf
to fix some spacing issues and all the "simple" stuffphpcs
and manually fixed the remaining issuesTesting Instructions
If automated tests pass we're good.
Testing Instructions for Keyboard
Not required.