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

WordPress Trac noreply at wordpress.org
Tue May 28 17:52:03 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):

 Replying to [comment:7 johnbillion]:
 > Overriding the values of core's own coding standards in core...

 Frankly I'm a bit unsure here. Looking at 46869.1.diff, it properly
 implements he (optional) exception to the rule for aligning equal signs
 here:
 {{{
 Exception: if you have a block of code that would be more readable if
 things are aligned, use spaces:

 [tab]$foo   = 'somevalue';
 [tab]$foo2  = 'somevalue2';
 [tab]$foo34 = 'somevalue3';
 [tab]$foo5  = 'somevalue4';
 }}}

 This is done by setting the
 `Generic.Formatting.MultipleStatementAlignment` PHPCS rule to match the
 above.

 > It's fine that core excludes certain checks in certain files (there's a
 bunch of those in phpcs.xml.dist currently), but it's not fine that core
 would globally override the configuration of a rule.

 A bit lost here too. Why shouldn't the WPCS rules be configurable? As far
 as I am aware, WPCS caters to a broader audience than just core. I think
 this is great :)

 > This sounds like it should be moved to [https://github.com/WordPress-
 Coding-Standards/WordPress-Coding-Standards the WPCS repo] to be fixed
 there.

 Yes, one of the WPCS rules seems to need a fix, as mentioned above (it
 currently doesn't "stop" at the end of the code block). I hope I'll have
 the time figure out how it works and make a pr.

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


More information about the wp-trac mailing list