Bug #11000

Run the spacing checks only if the comment isn't superfluous.

Added by Stefano Kowalke over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2010-11-20
Priority:Should have Due date:
Assignee:Stefano Kowalke % Done:

70%

Category:Commenting Spent time: -
Target version:0.0.2
Branch: Tags:
Votes: 0

Description

The sniff TYPO3.Commenting.FunctionDocCommenting checks for proper doc comments. If they are there, they have a "@param" and so on.

It checks also for the spaces between the doc params like:

@param array $argv array contains the arguments, which were post via CLI

and it checks if the comment if needed, because if no param pass to the function, no comment is necessary:

/**
 * Detects the action and calls the related methods.
 *
 * @param array $argv array contains the arguments, which were post via CLI
 */
public function cli_main() {
  // Some code
}

In the last case the sniffs mention an error for a superfluous comment, but additionally he throws errors for the false indention:

--------------------------------------------------------------------------------
 90 | ERROR | Tabs must be used to indent the variable type; spaces are not
    |       | allowed
    |       | (TYPO3.Commenting.FunctionDocComment.SpacingBeforeParamType)
 90 | ERROR | Tabs must be used to indent the variable comment; spaces are not
    |       | allowed
    |       | (TYPO3.Commenting.FunctionDocComment.SpacingBeforeParamComment)
 90 | ERROR | Tabs must be used to indent the variable name; spaces are not
    |       | allowed
    |       | (TYPO3.Commenting.FunctionDocComment.SpacingBeforeParamName)
 90 | ERROR | Superfluous doc comment at position 1
    |       | (TYPO3.Commenting.FunctionDocComment.ExtraParamComment)
--------------------------------------------------------------------------------

Solution:
Run the spacing checks only if the comment isn't superfluous.

History

Updated by Stefano Kowalke over 2 years ago

  • Status changed from New to Needs Feedback
  • % Done changed from 0 to 70

Updated by Stefano Kowalke over 2 years ago

  • Target version changed from Initial release to 0.0.3

Updated by Stefano Kowalke over 2 years ago

  • Status changed from Needs Feedback to Resolved
  • Target version changed from 0.0.3 to 0.0.2

Also available in: Atom PDF