[wp-trac] [WordPress Trac] #57426: Coding Standards: mark warnings that trigger CI failures as errors.

WordPress Trac noreply at wordpress.org
Fri Jan 6 04:02:08 UTC 2023


#57426: Coding Standards: mark warnings that trigger CI failures as errors.
--------------------------------------+-------------------------------
 Reporter:  peterwilsoncc             |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  coding-standards
--------------------------------------+-------------------------------

Comment (by jrf):

 @peterwilsoncc

 > If it is possible, I'd like to increase the severity of all coding
 standards failures in the test directory to error to match the behavior of
 the CI -- warnings cause the CI to error.

 That would require an adjustment to the Coding Standards handbook and Make
 posts to inform the decision.

 The `WordPress-Core` ruleset is aligned with the handbook and throws
 errors for those things which are rules and warnings for (strong)
 suggestions.

 ''Note: The last release of WPCS is not yet in line with recent updates to
 the handbook. This is being worked on and expected to be addressed in WPCS
 3.0.0.''

 > I use VS Code with PHPCS set up via one extension or another. The
 default config is to display errors in the editor window, warnings are
 suppressed per tests-alignment-as-warning.png

 That sounds like a problem with the configuration of the VS Code editor.
 Not a problem with the ruleset.

 > However, for contributors not aware of the need to check for warnings
 nothing will show.

 That sounds like a documentation issue about how to configure VS Code, not
 a problem with the ruleset.

 The [https://github.com/WordPress/WordPress-Coding-Standards/wiki WPCS
 wiki] contains links to tutorials about how to add WPCS to various editors
 correctly. If the existing (often external) tutorials aren't good enough
 or incomplete, I believe it would be a good idea to add new wiki pages
 with the correct information.
 It could also be considered to add a section to the
 [https://developer.wordpress.org/coding-standards/wordpress-coding-
 standards/ Coding Standards Handbook] about configuring various IDEs.

 > Reading through the annotated phpcs.xml file after posting this ticket,
 I am not sure it's possible so I'm happy enough if this ends up either a
 wontfix or a maybe later.

 To me, more than anything, this sounds like a dev education/documentation
 issue and not something which should be fixed in code/the ruleset.

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


More information about the wp-trac mailing list