This issue is to ideally remove the false positive sniffs for getInfo(), setUp() and tearDown() in test classes.

To my knowledge, all of core's D8 test class names end in either *Test.php or *TestBase.php. Just forgoing the warning in these collection of test files would be a great help.

According to @jhodgdon in #1533244-22: Make help module pass Coder Review item f),

Missing function doc comment
public static function getInfo() {

Our coding standards for tests unfortunately are not standard with our coding standards for other classes, and we specifically do *not* want doc comments on getInfo(), setUp(), and tearDown() methods in classes, so ignore this message for those methods.

Comments

lars toomre’s picture

Component: Coder Review » Code Sniffer
Category: task » feature

Changing the component and clarifying the category. This is coming up much in the sub-issues of #1518116: [meta] Make Core pass Coder Review.

lars toomre’s picture

Status: Active » Needs work
StatusFileSize
new46.91 KB

Attached is a work-in-progress patch for this issue.

I was having trouble figuring out how to extract the filename currentFile object. Perhaps someone can help there?

Also, I changed the error message text so that each is unique and we can see from the resulting report exactly which portion of the test caused the error.

lars toomre’s picture

StatusFileSize
new4.83 KB

Here is a patch without all of the Windows CRLF changes... Sorry about that.

yesct’s picture

Component: Code Sniffer » Coder Review
Issue tags: +Needs issue summary update, +Needs manual testing, +Needs steps to reproduce

this is probably both "needs work" (for the windows CRLF changes) and "needs review" (on what is there so far)

might help more this forward:

  • updating the issue summary
    (issue summary help doc in case a new contributor find this http://drupal.org/node/1427826)
  • and listing detailed next steps
    (this will probably be most helpful if done by someone familiar with the situation)

(I have a dream of automated standards testing of core patches.)

Also, some "steps to reproduce" or "steps to test" might help bring in people to aid this effort. (tips on contributor task doc page: http://drupal.org/node/1468198)

yesct’s picture

(ok the tags are not really helpful on contrib...)

traviscarden’s picture

Status: Needs work » Closed (works as designed)

This "works as intended" now on account of #338403: Use {@inheritdoc} on all class methods (including tests).