Make WordPress Core

Opened 3 days ago

Last modified 2 days ago

#65278 new defect (bug)

PHPCS scans can fail after running `build:dev`

Reported by: desrosj's profile desrosj Owned by:
Milestone: 7.1 Priority: normal
Severity: normal Version: 7.0
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

It seems that there are some cases where the PHPCS ruleset upstream within the gutenberg repository either differs or is not enforced the same way when compared to wordpress-develop.

@jorbin and I spotted this when running grunt prerelease locally after running build:dev in the 7.0 branch. The src/wp-includes/css/dist/registry.php file is not aligning array assignment operators (=>).

Change History (4)

#1 follow-up: @desrosj
3 days ago

A few thoughts on this:

  • This file is probably not being built into the best location. The folder name (css/dist) implies that it only contains built CSS files. But this registry.php file is an outlier.
  • I believe that this file is creating during the build script upstream, so it would either need to be formatted after being built, or the script/tool building it should be updated to align => operators.
  • This file should probably be added to the ignore list in phpcs.xml.dist (and also phpcompat.xml.dist) since it's not subject to version control. But if that were the case already, this would have been suppressed and not flagged to be fixed. If this path is chosen, then a full list of files that meet this criteria should be created and they should all be treated the same.
  • This file (and any other PHP files copied over wholesale from the gutenberg repository) should ideally be considered for being added to version control for better tracking of changes over time through tools like git bisect/git blame.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


3 days ago

#3 in reply to: ↑ 1 @desrosj
3 days ago

  • Keywords needs-patch added

Replying to desrosj:

A few thoughts on this:

  • This file is probably not being built into the best location. The folder name (css/dist) implies that it only contains built CSS files. But this registry.php file is an outlier.

#65279 has been opened to address this.

Last edited 3 days ago by desrosj (previous) (diff)

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


2 days ago
#4

  • Keywords has-patch added; needs-patch removed

After running build:dev, the auto-generated registry.php file in css/dist is not formatted to WordPress coding standards and causes grunt prerelease PHPCS checks to fail.

Props desrosj.
Fixes #65278.

Note: See TracTickets for help on using tickets.