Problem/Motivation
There are 9 violations of the Drupal.Commenting.DocComment.TagsNotGrouped rule in Examples.
We should fix them.
Proposed resolution
See the parent issue for instructions on how to install phpcs: #2176147: [meta] Coding standards review for D8 Examples
- Add the
Drupal.Commenting.DocComment.TagsNotGrouped sniff as a rule to phpcs.xml.dist.
- Run
phpcfb to make automated changes.
- Review the changes made by
phpcbf.
- Run
phpcs in order to verify that the error no longer exists.
- Submit a patch with all changed files, remembering to include the changes to
phpcs.xml.dist in the patch.
To Review
To review this issue you should:
How to run phpcs?
If you've installed phpcs as per the instructions in the meta, you can then change directories into the examples module and use .. to execute the phpcs executable you just installed. Like this:
$ pwd
/PATH/TO/drupal/modules/examples
$ ../../vendor/bin/phpcs -p -s
[ ...phpcs results print out... ]
Comments
Comment #2
mile23Comment #3
mile23Comment #4
das.gautam commentedComment #5
das.gautam commentedComment #6
minakshiPh commentedAdded the patch with fix.
Kindly review.
Thanks!
Comment #7
amit.drupal commentedReview #6 patch its working but found some basic coding stander spacing issues.
i do't know my patch is helpful or not.
Comment #8
mile23Thanks for working on this.
This issue should *only* change docblock comments to fix one coding standards error: Drupal.Commenting.DocComment.TagsNotGrouped
There are instructions for how to do this in the issue summary, and how to install the tools in the meta issue: #2176147: [meta] Coding standards review for D8 Examples
Also: We need to keep the @code tags, and not change the way @link tags work.
Basically, we want a reproducible fix for the Drupal.Commenting.DocComment.TagsNotGrouped error using the PHP CodeSniffer tool.
Comment #9
mile23We can't do this until #2502837: Multiple code snippets, todos, and links are allowed in file doc blocks is fixed.
Comment #10
avpadernoComment #11
avpadernoProjects hosted on drupal.org now use GitLab CI for testing, which runs a phpcs job with its own phpcs.xml.dist file. The PHP_CodeSniffer warnings/errors have been already fixed.
I am closing this issue as outdated.
Comment #13
avpadernoBy reading #2502837: Multiple code snippets, todos, and links are allowed in file doc blocks, I gather the error message quoted in the issue summary is no longer returned by PHP_CodeSniffer, with the rules used by Drupal core.