The checking for "no blank line after inline comment" is done in both the Drupal and DrupalPractice set of sniffs. This results in one line getting the same warning message twice. However, they are subtly different in that the Drupal standard allows a standalone @todo comment with a blank line following it, whereas DrupalPractice gives a warning for any type of comment with a blank line after.

function something($name) {

  // @todo Only fails DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter.

  // This is not a @todo comment, and it produces two 'no blank line' warnings.
  // It fails both DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter
  // and also Drupal.Commenting.InlineComment.SpacingAfter.

}

produces the following:

-----------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
-----------------------------------------------
 13 | WARNING | [ ] There must be no blank line following an inline comment
 (DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter)
 17 | WARNING | [x] There must be no blank line following an inline comment
 (Drupal.Commenting.InlineComment.SpacingAfter)
 17 | WARNING | [ ] There must be no blank line following an inline comment
 (DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter)
-----------------------------------------------

Issue #2159253: Coder - alter requirements about no blank line following an inline comment contains a discussion about allow @todo and moving the check to DrupalPractice. However, it seems that the check is in two places now. Is it the intended result that one identical warning is given by two separate sniffs?

Comments

jonathan1055 created an issue.