[wp-trac] [WordPress Trac] #44600: Update WPCS to 1.0.0, and enforce coding standards

WordPress Trac noreply at wordpress.org
Thu Aug 16 14:16:38 UTC 2018


#44600: Update WPCS to 1.0.0, and enforce coding standards
------------------------------+-------------------------------
 Reporter:  pento             |       Owner:  pento
     Type:  task (blessed)    |      Status:  assigned
 Priority:  normal            |   Milestone:  5.0
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  coding-standards
------------------------------+-------------------------------

Comment (by jrf):

 > I understand this is difficult (impossible?) to fix with the parser.
 Thinking to amend the core coding standards to strongly discourage such
 code, even only as a recommendation.

 Correct, this is impossible to auto-fix, though it will be relatively easy
 to write a sniff to warn against multi-line parameters (`line count >
 param count`), but how to handle function calls with inline comments ?

 Think:
 {{{#!php
 <?php
 printf(
     /* translators: 1: explanation; 2: explanation. */
     esc_html__('Text %1$s with %2$s replacements'),
     $replacement1,
     $replacement2
 );
 }}}


 Disregard lines which only contain whitespace and a comment completely ?

 What about completely blank lines in function calls ?

 Things like will need to be discussed in the WPCS issue before such a
 sniff could be written.

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


More information about the wp-trac mailing list