Problem/Motivation
There are 10 violations of the Drupal.Commenting.DocComment.TagGroupSpacing 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.TagGroupSpacing 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
shruti1803 commentedTry to fix the errors. Attaching patch.
Comment #6
rasikap commentedComment #7
shruti1803 commentedComment #9
shruti1803 commentedSorry, wrong patch applied. Attaching new patch.
Comment #11
mile23Thanks for working on this.
This issue should *only* change docblock comments to fix one coding standards error: Drupal.Commenting.DocComment.TagGroupSpacing
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.TagGroupSpacing error using the PHP CodeSniffer tool.
Comment #12
shruti1803 commentedHi @Mile23. I have fixed the issues using the PHP CodeSniffer tool.
Comment #14
shruti1803 commentedComment #15
mile23Thanks, @shruti1803.
Again...
You have to:
drupal/coderbe version 8.2.8, and thatphpcsbe configured properly.Drupal.Commenting.DocComment.TagGroupSpacingrule to the examples project'sphpcs.xml.distfile.../../phpcs -psto see the errors that belong to this rule.../../phpcbfto automatically fix some of them.../../phpcs -psto see any remaining errors.Thanks. :-)
Comment #16
minakshiPh commentedAdded patch with some changes as mentioned in #15.
Kindly review.
Thanks!
Comment #17
mile23Still all the same problems as #11. I think the real problem here is that when that patch was made, coder had problems with @code annotations and others.
Comment #18
mile23Drupal.Commenting.DocComment.TagGroupSpacing is currently not excluded from our Drupal.Commenting rule, and including it explicitly doesn't cause PHPCS to warn us about anything.