[wp-trac] [WordPress Trac] #46869: Fix PHPCS configuration

WordPress Trac noreply at wordpress.org
Wed Apr 10 01:50:00 UTC 2019


#46869: Fix PHPCS configuration
------------------------------+---------------------
 Reporter:  azaozz            |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+---------------------

Comment (by azaozz):

 Replying to [comment:1 pento]:

 Was thinking `WordPress.PHP.YodaConditions.NotYoda` needs to be disabled.
 Then  `WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys`
 should allow for spaces around all array keys as in the JS standards (the
 decision there was to match PHP and JS, if I remember right).

 Another is to perhaps replace
 `WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned` with
 `Generic.Formatting.MultipleStatementAlignment` as the latter allows
 setting of maximum spaces to insert. That will help to keep aligned
 associative arrays easier to read and match
 https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/#indentation better (we'll need to add a setting for it
 though).

 Alternatively we can set the priority to lower than 5. That would make the
 rule(s) "optional", i.e. they will still be available but won't prevent
 building or trigger errors in Travis.

 I'll make a patch so we can test and/or have a better look :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46869#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list