Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#50010 new task (blessed)

wp-includes/blocks shouldn't be excluded from coding standards

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords: good-first-bug needs-testing has-patch
Focuses: coding-standards Cc:

Description

The wp-incudes/blocks directory is excluded from coding standards. This is presumably because the files are imported from Gutenberg, but there's no reason these files shouldn't adhere to core's coding standards.

Needs some investigation into why the directory is excluded, whether the files need updating in Gutenberg to adhere to core coding standards, and corresponding tickets on the Gutenberg repo as necessary.

Change History (5)

#1 @noisysocks
2 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Type changed from enhancement to task (blessed)

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


22 months ago

#3 @lopo
10 months ago

I tried to enable CS checks on the folder, and we get just four sets of errors like:

 1 | ERROR | [x] When a multi-item array uses associative keys, each value should start on a new line.
   |       |     (WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound)
 1 | ERROR | [x] File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

on navigation/view.asset.php, navigation/view.min.asset.php, file/view.asset.php and file/view.min.asset.php because they all like this:

<?php return array('dependencies' => array(), 'version' => '3776ea67846b3bb10fe8f7cdd486b0ba');

Obviously they're trivial problems but as far as I know those files are autogenerated, so with my limited knowledge of Gutenberg I'm not sure what can be done about them.

This ticket was mentioned in PR #2644 on WordPress/wordpress-develop by Rahe.


7 months ago
#4

  • Keywords has-patch added

Exclude any asset file from the blocs directory since they are auto-generated.

Trac ticket: https://core.trac.wordpress.org/ticket/50010

#5 @Rahe
7 months ago

Hello,

I've added a PR for this since, as said, the PHP files are auto-generated.
But maybe there will never be any PHP files into theses directories ?

Note: See TracTickets for help on using tickets.