[wp-trac] [WordPress Trac] #52025: Coding Standards: Single-Line Code Comment Format Used In Place Of Multi-Line Format.

WordPress Trac noreply at wordpress.org
Fri Jan 29 18:46:48 UTC 2021


#52025: Coding Standards: Single-Line Code Comment Format Used In Place Of Multi-
Line Format.
----------------------------+-------------------------------------
 Reporter:  pinkalbeladiya  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:  5.7
Component:  Media           |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  docs, coding-standards
----------------------------+-------------------------------------
Changes (by SergeyBiryukov):

 * keywords:  close =>
 * status:  closed => reopened
 * resolution:  wontfix =>
 * milestone:  Awaiting Review => 5.7


Comment:

 Replying to [comment:6 davidbaumwald]:
 > Running some REGEX on the source, there are thousands of instances of
 the single-line comment style being used for multi-line comments.  Also,
 there doesn't appear to be any rule in the
 [https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/ PHP Coding Standards] that forbids code comments in this
 format.

 There is a [https://make.wordpress.org/core/handbook/best-practices
 /inline-documentation-standards/php/#5-inline-comments section in the
 documentation standards] that clarifies which format is generally
 recommended.

 This was previously corrected for other inline comments in core in
 [47122]. I think I opted to keep comments with one or two lines in single
 line format, and switch comments with three or more lines to the multi-
 line format.

 It looks like this is the only instance introduced since then that's not
 in an external library, so we might as well fix it :)

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


More information about the wp-trac mailing list