Opened 4 years ago
Closed 4 years ago
#52025 closed defect (bug) (fixed)
Coding Standards: Single-Line Code Comment Format Used In Place Of Multi-Line Format.
Reported by: | pinkalbeladiya | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | |
Focuses: | docs, coding-standards | Cc: |
Description
Wordpress have a comment structure. In the file developer use the single line comment structure. Replace it with the wordpress comment structure.
Attachments (1)
Change History (11)
#1
@
4 years ago
- Component changed from General to Comments
- Keywords needs-patch added; has-patch removed
- Version 5.6 deleted
#2
follow-up:
↓ 3
@
4 years ago
- Component changed from Comments to Media
- Focuses docs coding-standards added
- Keywords reporter-feedback added; needs-patch removed
@mukesh27 I actually think this is not in the Comments component, and the ticket might be titled inaccurately. It seems this ticket concerns a code comment block on line 74 in wp-admin/includes/class-wp-media-list-table.php.
@pinkalbeladiya Can you confirm this is still an issue in version 5.6? I took a look at the code comment in your screenshot, but there appears to be no formatting problems in the most recent version.
#3
in reply to:
↑ 2
@
4 years ago
@mukesh27 Yes, This is in wordpress 5.6. See the link https://prnt.sc/w3053l
Replying to davidbaumwald:
@mukesh27 I actually think this is not in the Comments component, and the ticket might be titled inaccurately. It seems this ticket concerns a code comment block on line 74 in wp-admin/includes/class-wp-media-list-table.php.
@pinkalbeladiya Can you confirm this is still an issue in version 5.6? I took a look at the code comment in your screenshot, but there appears to be no formatting problems in the most recent version.
#4
follow-up:
↓ 5
@
4 years ago
@pinkalbeladiya Can you describe the issue/problem with the comment? I've read the comment a few times, but I'm not seeing an issue with the formatting of it.
#5
in reply to:
↑ 4
@
4 years ago
I think the format of comment is:
/*
*
*
*
*/
And there is used sigle line comment.
Replying to davidbaumwald:
@pinkalbeladiya Can you describe the issue/problem with the comment? I've read the comment a few times, but I'm not seeing an issue with the formatting of it.
#6
follow-up:
↓ 9
@
4 years ago
- Keywords close added; reporter-feedback removed
@pinkalbeladiya Thanks for the additional context! I actually don't think this is an issue. 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 PHP Coding Standards that forbids code comments in this format.
Tagging this as close
for now.
#7
@
4 years ago
- Summary changed from Comment Error to Coding Standards: Single-Line Code Comment Format Used In Place Of Multi-Line Format.
#9
in reply to:
↑ 6
@
4 years ago
- Keywords close removed
- Milestone changed from Awaiting Review to 5.7
- Resolution wontfix deleted
- Status changed from closed to reopened
Replying to 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 PHP Coding Standards that forbids code comments in this format.
There is a 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 :)
wp-admin\includes\class-wp-media-list-table