FILE: /home/anoopjohn/projects/drupal/drupal-8/core/authorize.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 51 | ERROR | [x] Parameter comment indentation must be 3 spaces,
    |       |     found 2 spaces

Comments

anoopjohn created an issue. See original summary.

anoopjohn’s picture

Please find the patch for the correction.

zuhair_ak’s picture

Status: Active » Reviewed & tested by the community

This is the only coder issue in authorize.php. Tested patch and found working against latest 8.2.x-dev branch.

alexpott’s picture

Title: Minor issues reported by coder in core/authorize.php » Ensure core compliance to Drupal.Commenting.FunctionComment.ParamCommentIndentation
Status: Reviewed & tested by the community » Needs work
Parent issue: » #2571965: [meta] Fix PHP coding standards in core, stage 1

See https://www.drupal.org/core/scope - this issue does not have the correct scope. We should be fixing this rule in all of core and enabling the rule in core/phpcs.xml.dist.

There does not seem to be an issue to enable Drupal.Commenting.FunctionComment.ParamCommentIndentation on #2571965: [meta] Fix PHP coding standards in core, stage 1 so let's re-scope this issue.

anoopjohn’s picture

Thanks @alexpott for pointing that issue out. Will review and see how I can contribute towards this effort.

anoopjohn’s picture

I have gone through all issues related to the rule Drupal.Commenting.FunctionComment.ParamCommentIndentation in the Drupal.Commenting.FunctionComment sniff and have prepared two patches. The first patch is with fixes that just had minor spacing fixes and can be reviewed quite easily. Most of the issues were of this type. The second patch involved moving orphan comment paragraphs from after @params section to before it and similar changes and requires slightly more detailed review.

I have only made the fixes to the files in the core directory and sub folders but not for files outside it. Please confirm if that is the correct approach to take.

anoopjohn’s picture

Status: Needs work » Needs review
alexpott’s picture

Status: Needs review » Needs work

@anoopjohn nice work! And good call here on splitting up the simple from the complex. I think we should do the simple fixes in this issue and then open a followup to add the rule to phpcs.xml.dist and do the complex fixes.

So next steps here are
1. to upload the simple patch again - so it is the last patch on the issue - this makes the rtbc retest work as expected and tells people which patch to review
2. Create the followup and link it to this issue.
3. Get reviews of the "simple" patch.

anoopjohn’s picture

Status: Needs work » Needs review
StatusFileSize
new40.61 KB

Thanks for the feedback @alexpott. I am attaching the patch with the simple fixes here. I will create a new issue and attach the second patch there.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.11 KB

So it's not possible to add phpcs.xml.dist only Drupal.Commenting.FunctionComment.ParamCommentIndentation - need to add all of Drupal.Commenting.FunctionComment - which results in lots and lots of things to fix. What we can do is change the severity of all the other sub sniffs so we only report on this one. The txt file attached is a patch that does exactly that. After applying that and the two patches on this issue there are no phpcs errors.

Therefore we can continue with the plan outlined in #8 and we can add the change to phpcs.xml.dist in the followup issue.

I've reviewed the patch in #9 and all the changes made are whitespace. This is good to go.

alexpott’s picture

Title: Ensure core compliance to Drupal.Commenting.FunctionComment.ParamCommentIndentation » Ensure core compliance to Drupal.Commenting.FunctionComment.ParamCommentIndentation (part 1)

Committed 87378ae and pushed to 8.1.x and 8.2.x. Thanks!

  • alexpott committed 904b0de on 8.2.x
    Issue #2700661 by anoopjohn: Ensure core compliance to Drupal.Commenting...
alexpott’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.