Problem/Motivation
PHPCS checks for tracker module report multiple issues with code standards.
Steps to reproduce
Run phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml core/modules/tracker/
The output is:
FILE: core/modules/tracker/tracker.module
------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------
93 | WARNING | [x] There must be no blank line following an inline comment
266 | ERROR | [ ] Type hint "\Drupal\node\NodeInterface" missing for $node
323 | WARNING | [x] There must be no blank line following an inline comment
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------
FILE: core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
36 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------
FILE: core/modules/tracker/tests/src/Functional/TrackerTest.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
58 | ERROR | [x] Missing function doc comment
63 | ERROR | [ ] The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
96 | ERROR | [ ] The array declaration extends to column 204 (the limit is 80). The array content should be split up over multiple lines
182 | ERROR | [ ] The array declaration extends to column 204 (the limit is 80). The array content should be split up over multiple lines
209 | ERROR | [ ] The array declaration extends to column 204 (the limit is 80). The array content should be split up over multiple lines
335 | WARNING | [x] There must be no blank line following an inline comment
338 | WARNING | [x] There must be no blank line following an inline comment
468 | ERROR | [x] Parameter comment must end with a full stop
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateTrackerSettingsTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
14 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------------------------------------------------
FILE: core/modules/tracker/tracker.views.inc
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
160 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------
Comments
Comment #2
hardikpandya commentedComment #3
larowlanThis doesn't meet our scope guidelines
Please refer to the existing coding standards meta
We don't fix issues per module, we fix them by rule
Comment #4
longwaveThank 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.
Comment #5
larowlanThanks @longwave - I was on my phone so didn't have capacity for a longer response