[wp-trac] [WordPress Trac] #46869: Fix PHPCS configuration
WordPress Trac
noreply at wordpress.org
Tue May 28 01:01:30 UTC 2019
#46869: Fix PHPCS configuration
------------------------------+-------------------------------
Reporter: azaozz | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: needs-testing | Focuses: coding-standards
------------------------------+-------------------------------
Comment (by azaozz):
@jrf thanks so much for offering to help on Slack :) Frankly I'm not sure
if I'm doing something "not-right", or it can't be done that way.
Was trying to configure WordPress.Arrays.MultipleStatementAlignment to
work similarly to Generic.Formatting.MultipleStatementAlignment, i.e. stop
on empty lines and limit the white space that is inserted. Testing this
code with the settings in the above patch:
{{{
$arr = array(
'one' => array(
'test' => 1,
'test-test' => 1,
'test-test-test' => 1,
'test-test-test-test-test-test-test' => 1,
'test-test-test-test-test-test-test-test-test-test-test'
=> 1,
),
'one-longer' => array(
'test' => 1,
),
);
}}}
Results in these errors:
{{{
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
13 | WARNING | [x] Array double arrow not aligned correctly;
| | expected 31 space(s) between "'test'" and double
| | arrow, but found 11.
| |
(WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned)
14 | WARNING | [x] Array double arrow not aligned correctly;
| | expected 26 space(s) between "'test-test'" and
| | double arrow, but found 6.
| |
(WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned)
15 | WARNING | [x] Array double arrow not aligned correctly;
| | expected 21 space(s) between "'test-test-test'"
| | and double arrow, but found 1.
| |
(WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
}}}
despite the `<property name="maxColumn" value="20"/>` setting. Also I
couldn't find a way to make it not "bleed" across different code blocks as
in this commit: https://core.trac.wordpress.org/changeset/45453/trunk/src
/wp-admin/includes/list-table.php (the red is proper, the green is... out
of alignment) :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46869#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list