There's a handful of phpcs issues to be fixed.
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml core/modules/comment
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/comment.module
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------
222 | WARNING | There must be no blank line following an inline comment
--------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentTypeForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
------------------------------------------------------------------------------------------------------------------------------------------
78 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
121 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
148 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
163 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
168 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentTypeListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
32 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
33 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/Entity/Comment.php
----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------
113 | WARNING | There must be no blank line following an inline comment
----------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
32 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------------------
111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
129 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
130 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
136 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
141 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
144 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
145 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
146 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
188 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
82 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
384 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentStorage.php
----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------
160 | WARNING | There must be no blank line following an inline comment
----------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentLazyBuilders.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
173 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
180 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
186 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
197 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
209 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentTranslationHandler.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
33 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /Applications/MAMP/htdocs/drupal-9-dev/core/modules/comment/src/CommentStatistics.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
166 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
182 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | Screenshot 2020-03-24 at 9.46.33 AM.png | 381.1 KB | naresh_bavaskar |
| #26 | 3109146-26.patch | 15.41 KB | kishor_kolekar |
| #26 | interdiff-17-26.txt | 4.1 KB | kishor_kolekar |
| #24 | 3109146-24.patch | 18.02 KB | prabha1997 |
| #24 | interdiff_17-24.txt | 5.68 KB | prabha1997 |
Comments
Comment #2
hardik_patel_12 commentedComment #3
avpadernoSince there isn't any patch, the status is still Active.
Comment #4
longwaveI can't find a change record or documentation for it but I thought that we should no longer call t() in test assertion messages as we never translate these messages and we aren't testing the translation system directly, so I think a lot of these calls should be removed rather than converted.
Comment #5
hardik_patel_12 commentedPlease correct me if i understand wrong that you trying to suggest that we should remove all t() call in test assertion messages
Comment #6
hardik_patel_12 commentedKindly review a patch.
Comment #7
hardik_patel_12 commentedComment #8
hardik_patel_12 commentedComment #9
hardik_patel_12 commentedKindly review a new patch.
Comment #10
longwaveI don't think we should be removing these blank lines, they are useful to separate the comments.
Same here.
Comment #11
hardik_patel_12 commentedRemoving spaces as suggested above, kindly review a new patch.
Comment #14
hardik_patel_12 commentedKindly review a new patch.
Comment #15
hardik_patel_12 commentedComment #17
hardik_patel_12 commentedKindly review a new patch.
Comment #18
hardik_patel_12 commentedComment #19
hash6 commentedComment #20
naresh_bavaskarComment #21
avpadernoComment #22
naresh_bavaskarThere are some more coding standards that need to fixed in this module.
Comment #23
prabha1997 commentedI am working on this issue
Comment #24
prabha1997 commentedComment #26
kishor_kolekar commentedplease review the patch
Comment #27
kishor_kolekar commentedComment #29
neelam_wadhwani commentedComment #30
neelam_wadhwani commentedComment #31
neelam_wadhwani commentedComment #32
neelam_wadhwani commentedThere were small changes because of which patch was getting failed.
Updated the changes.
Comment #33
naresh_bavaskarComment #34
naresh_bavaskarI found some coding standards that still need to be fixed.
Comment #35
neelam_wadhwani commentedComment #36
xjmThank you for your work on cleaning up Drupal core's code style!
In order to fix core coding standards in a maintainable way, all our coding standards issues should be done on a per-rule basis across all of core, rather than fixing standards in individual modules or files. We should also separate fixes where we need to write new documentation from fixes where we need to correct existing standards. This all should be done as part of #2571965: [meta] Fix PHP coding standards in core, stage 1. A good place to start is the child issues of #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard.
For background information on why we usually will not commit coding standards fixes that aren't scoped in that way, see the core issue scope guidelines, especially the note about coding standards cleanups. That document also includes numerous suggestions for scoping issues including documentation coding standards cleanups.
Contributing to the overall plan above will help ensure that your fixes for core's coding standards remain in core the long term.
Since this issue is a hodgepodge of many different standards for a single module, I'm closing it as wontfix. I encourage you to collaborate on other coding standards cleanups that fix a single rule across all of core according to the scoping guidelines. Thanks!