Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 19 months ago

#58918 closed enhancement (fixed)

HTML API: Adjust code stying to Gutenberg's linter's preferences

Reported by: dmsnell's profile dmsnell Owned by: bernhard-reiter's profile Bernhard Reiter
Milestone: 6.4 Priority: normal
Severity: normal Version: 6.3
Component: HTML API Keywords: has-patch commit
Focuses: coding-standards Cc:

Description

In this patch we're adjusting the code style according to the rules that the linting process in Gutenberg requires. There should be no code changed by this patch.

Change History (14)

This ticket was mentioned in PR #4918 on WordPress/wordpress-develop by @dmsnell.


20 months ago
#1

Trac: #58918-ticket

In this patch we're adjusting the code style according to the rules that the linting process in Gutenberg requires. There should be no code changed by this patch.

#2 @swissspidy
20 months ago

Shouldn't we rather align the two coding standards? 🤔

Code in WP should follow the WP coding standards, not some external ones, no? I'd recommend checking with #core-coding-standards on this.

#3 @dmsnell
20 months ago

I would love that and have been asking for it @swissspidy. I'm not able to tackle that challenge though, so I'm more focused on making sure that code isn't arbitrarily blocked in WordPress by rules in a separate repo.

Of note, Gutenberg is WordPress and its coding standards are WordPress coding standards.

None of the changes in this patch conflict with the CI builds for Core: they satisfy both repos (except for one remaining case in Gutenberg where I believe that the CI job has mis-analyzed something).

#4 @swissspidy
20 months ago

its coding standards are WordPress coding standards.

Obviously not, otherwise you wouldn't have to make this change :-)

Can you perhaps elaborate on why this code needs to satisfy the different CS requirements from the Gutenberg repo? As far as I can tell this code only lives in the WordPress repo.

#5 @dmsnell
20 months ago

Obviously not, otherwise you wouldn't have to make this change :-)

ha! tell that to the people implementing WPCS 😄

Can you perhaps elaborate on why this code needs to satisfy the different CS requirements from the Gutenberg repo? As far as I can tell this code only lives in the WordPress repo.

This is part of a standard "backporting" process to bring updates in Core to Gutenberg. Because of recurring conflicts arising between people who work on different sides of the codebase (Gutenberg and WordPress SVN) I have been building code in Core first, bringing them over to Gutenberg.

This code does live in Gutenberg and must live in Gutenberg until Gutenberg no longer supports versions of Core that don't have the required library. Even then, as long as updates are applied in Core they need to be backported into Gutenberg to avoid crashing or corrupting sites with the plugin activated.

This should be a trivial patch; is there anything in the contents of the patch you object to? I don't believe it's going to be a productive place to address longstanding systematic issues between Gutenberg and Core 😄

For what it's worth, I do believe that it's the goal of people working on the WordPress Coding Standards to harmonize the repos. Unfortunately we're left stranded until that happens because they've decided to reject patches with issues; so we go through the ritual of updating style so we aren't blocked 🤷‍♂️ This is the same process for updating any Core code that Gutenberg relies on.

#6 @swissspidy
20 months ago

This code does live in Gutenberg

Where? It is not clear to me and I could not find these classes in the Gutenberg repo right a way.

I don't have any objections to the contents of the patch, but there really was not enough context on the ticket initially, hence the many questions.

#7 @dmsnell
20 months ago

Where

I'm bringing the code over in #52908 which is currently blocked because of the linting issues (even though it's merged code and supposed to be a "blessed" PR).

I don't want to split the codebases which is why I'm trying to address this here first, so there's never two divergent versions of the code.

there really was not enough context on the ticket initially, hence the many questions.

Sorry. I was terse because I'm used to making these updates and there's not much to say about them, but I can include more context in the future.

Thanks for taking a look at it!

#8 @SergeyBiryukov
20 months ago

  • Focuses coding-standards added

#9 @dmsnell
20 months ago

Is there any opposition to this? If not, can someone merge it so we can push the backport into Gutenberg?

#10 @swissspidy
20 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.4

#11 @dmsnell
20 months ago

Without hearing any further objection, can someone merge this?

#12 @Bernhard Reiter
20 months ago

  • Owner set to Bernhard Reiter
  • Resolution set to fixed
  • Status changed from new to closed

In 56363:

HTML API: Adjust code styling to Gutenberg's linter's preferences.

Adjust the code style according to the rules that the linting process in Gutenberg requires.

There are only a couple code changes that should have no effect on the runtime:

  • A missing check to verify that only UTF-8 is supported has been added (brought up because it was identified as an undefined variable).
  • A few return false; statements have been added to avoid having the linter complain that functions don't return a value despite indicating they return bool. The functions are stubs for coming support and currently throw, so the return statements are unreachable.

Props dmsnell, costdev, davidbaumwald, peterwilsoncc, SergeyBiryukov.
Fixes #58918.

#14 @jorbin
19 months ago

In 56376:

HTML API: Fix missing * for docblock.

Follow up to [56363].

Props dmsnell.
See #58918. Fixes #59010.

Note: See TracTickets for help on using tickets.