[wp-trac] [WordPress Trac] #47632: Coding Standards fixes for WP 5.3

WordPress Trac noreply at wordpress.org
Fri Jul 19 07:58:31 UTC 2019


#47632: Coding Standards fixes for WP 5.3
----------------------------+-------------------------------
 Reporter:  pento           |       Owner:  pento
     Type:  task (blessed)  |      Status:  assigned
 Priority:  normal          |   Milestone:  5.3
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by pento):

 Here's where we're at now:


 {{{
 PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
 ----------------------------------------------------------------------
 SOURCE                                                           COUNT
 ----------------------------------------------------------------------
 WordPress.PHP.StrictComparisons.LooseComparison                  2511
 WordPress.PHP.YodaConditions.NotYoda                             652
 WordPress.PHP.StrictInArray.MissingTrueStrict                    511
 WordPress.WP.I18n.MissingTranslatorsComment                      365
 WordPress.NamingConventions.ValidVariableName.VariableNotSnakeC  321
 WordPress.DB.PreparedSQL.InterpolatedNotPrepared                 177
 WordPress.DB.PreparedSQL.NotPrepared                             116
 WordPress.Files.FileName.InvalidClassFileName                    12
 ----------------------------------------------------------------------
 A TOTAL OF 4665 SNIFF VIOLATIONS WERE FOUND IN 8 SOURCES
 ----------------------------------------------------------------------
 }}}

 I'm excited that the total number of violations is higher than when I
 started this ticket. 🙃

 Violations of note:

 - `WordPress.PHP.YodaConditions.NotYoda`: There's still a discussion to be
 had over whether we keep using Yoda Conditions or not. I don't intend to
 tackle these violations ''en masses'' until after that discussion.
 - `WordPress.DB.PreparedSQL.NotPrepared`: I don't think we need to look at
 these until after [https://github.com/WordPress/WordPress-Coding-
 Standards/issues/1331 WPCS1331] is addressed.
 - `WordPress.DB.PreparedSQL.InterpolatedNotPrepared`: These violations are
 mostly more complex versions of `NotPrepared`, where queries are built up,
 then intentionally interpolated at the end. See `WP_*_Query` for examples.
 - `WordPress.Files.FileName.InvalidClassFileName`: Fixing these is
 tedious. I'll do one or two at a time until they're finished.

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


More information about the wp-trac mailing list