Download & Extend

Modify sniff for "Missing function doc comment" for test classes

Project:Coder
Version:7.x-2.x-dev
Component:Coder Review
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

#1

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

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

#2

Status:active» needs work

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.

AttachmentSize
1805550-2-sniff-missing-docblock.patch 46.91 KB

#3

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

AttachmentSize
1805550-3-sniff-missing-docblock.patch 4.83 KB

#4

Component:Code Sniffer» Coder Review

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)

#5

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

nobody click here