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

Mile23 created an issue. See original summary.

mile23’s picture

Issue summary: View changes
mile23’s picture

Issue tags: +Novice
shruti1803’s picture

Status: Active » Needs review
StatusFileSize
new17.98 KB

Try to fix the errors. Attaching patch.

Status: Needs review » Needs work

The last submitted patch, 4: fix-2735935-4.patch, failed testing.

rasikap’s picture

Assigned: Unassigned » rasikap
shruti1803’s picture

Status: Needs work » Needs review
StatusFileSize
new963 bytes

Status: Needs review » Needs work

The last submitted patch, 7: hook_help-2802757-7.patch, failed testing.

shruti1803’s picture

Status: Needs work » Needs review
StatusFileSize
new17.98 KB

Sorry, wrong patch applied. Attaching new patch.

Status: Needs review » Needs work

The last submitted patch, 9: fix-2735935-7.patch, failed testing.

mile23’s picture

Thanks 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.

shruti1803’s picture

Assigned: rasikap » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.1 KB

Hi @Mile23. I have fixed the issues using the PHP CodeSniffer tool.

Status: Needs review » Needs work

The last submitted patch, 12: fix-2735935-12.patch, failed testing.

shruti1803’s picture

Status: Needs work » Needs review
StatusFileSize
new7.57 KB
mile23’s picture

Status: Needs review » Needs work

Thanks, @shruti1803.

Again...

You have to:

  • Install the tools as shown in #2176147: [meta] Coding standards review for D8 Examples It's important that drupal/coder be version 8.2.8, and that phpcs be configured properly.
  • Add the Drupal.Commenting.DocComment.TagGroupSpacing rule to the examples project's phpcs.xml.dist file.
  • Run ../../phpcs -ps to see the errors that belong to this rule.
  • Run ../../phpcbf to automatically fix some of them.
  • Run ../../phpcs -ps to see any remaining errors.
  • Make sure all changes fit within the scope of this issue.
  • Make a patch and submit it.

Thanks. :-)

minakshiPh’s picture

Status: Needs work » Needs review
StatusFileSize
new6.33 KB
new9.85 KB

Added patch with some changes as mentioned in #15.

Kindly review.
Thanks!

mile23’s picture

Status: Needs review » Needs work

Still 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.

mile23’s picture

Status: Needs work » Closed (outdated)

Drupal.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.