Opened 6 months ago
Last modified 2 months ago
#62166 new defect (bug)
Bundled themes: PHPCS "exactly one blank line after the file comment"
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | docs, coding-standards | Cc: |
Description (last modified by )
This ticket is created to serve as the base for resolving the phpcs error such as
"There must be exactly one blank line after the file comment" for the whole codebase
Command to check for this Error :-
phpcs --standard=WordPress --extensions=php file_path
Currently the error has been resolved in the following themes:-
Twenty Thirteen, Twenty Fifteen :- By this patch 62160.patch
Twenty Fourteen: #62098 / [59158]
Twenty Sixteen: #62160
Attachments (7)
Change History (17)
@
6 months ago
Fix phpcs error for following themes: seventeen, nineteen, twenty, twenty-one, twenty-two, twenty-three,
This ticket was mentioned in PR #7500 on WordPress/wordpress-develop by @dhruvang21.
6 months ago
#3
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/62166
Fixes PHPCS Error :- "There must be exactly one blank line after the file comment"
#4
@
6 months ago
- Component changed from General to Bundled Theme
- Description modified (diff)
- Severity changed from normal to minor
- Summary changed from PHPCS Errors to Bundled themes: PHPCS "exactly one blank line after the file comment"
#5
@
6 months ago
In PR 7500, I marked one line that should not be added in Twenty Twenty-Two's block-patterns file (out of 187 files).
Additional notes:
- The error is 'SpacingAfterComment' from PHPCS.
- Core-40039 only updated Twenty Seventeen and newer themes for different coding standards two years ago. However, [59158] already made 'SpacingAfterComment' changes for Twenty Fourteen, and consistency is good.
#6
@
6 months ago
I did not add the 'changes-requested' keyword, but what I requested is done now :)
@
6 months ago
I have checked another theme and core files and found above mentioned change. I have resolved it and added its patch for the same.
#7
@
4 months ago
Hi @dhruvang21 @mdviralsampat
When I compare the patches and the pull request, I do not see any theme related changes in the patches that are not already part of the pull request, can you please confirm this?
It is not clear to me why multiple patches were submitted.
The patches contain changes that are unrelated to the themes, and those changes must not be committed as part of this ticket.
#8
@
4 months ago
Hi @poena,
I have made changes only in the theme files since this ticket specifically addresses resolving the PHPCS issues within themes. I believe @mdviralsampat submitted a patch for the core file as well, but I have not included those changes in my PR.
@
4 months ago
I have checked twenty twenty four theme and found few files where we need to resolve phpcs errors/warnings. I have resolved it and added its patch for the same.
@sabernhardt commented on PR #7500:
2 months ago
#9
I checked each of the PHP files and found one more with an extra line (to remove): twentytwentythree\functions.php
.
#10
@
2 months ago
- Focuses docs added
PR 7500 does not edit the following class files, and I am not sure whether this ticket should change them.
twentyeleven\inc\widgets.php
twentyfourteen\inc\featured-content.php
twentyfourteen\inc\widgets.php
I do not think that they should simply add an empty line between the comment and the class Featured_Content {
line. However, the two widget class files seem to combine the file header and the class docblock (compared to how Twenty Nineteen separates them).
#62437 can address any edits to package
/subpackage
/since
details in block themes such as Twenty Twenty-Four (62166.5.patch).
hello @mukesh27,
Command you asked for checking the error is mentioned in the ticket description and working on resolving the error by creating Patch for the other theme as well.