Closed (fixed)
Project:
Drupal Code Sniffer
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2011 at 12:43 UTC
Updated:
5 Apr 2012 at 18:20 UTC
I ran PAReview.sh on my module: http://ventral.org/node/146/revisions/495/view . It correctly found several errors, including
// This comment lacks ending punctuation
However, it did not notice
// This comment lacks ending punctuation (like the last one)
Comments
Comment #1
klausiYes, the sniff is conservative because comments can also look like this:
This does not require punctuation at the end as it is not a sentence. The sniff ignores comments where the last word contains non-alpha characters (I think). Anyway, patches welcome.
Comment #3
pdrake commentedFixed (http://drupalcode.org/project/drupalcs.git/commit/3490b5f). The inline comment punctuation detection now handles the following scenarios properly:
// This comment lacks ending punctuation
test();
// This comment lacks ending punctuation (like the last one)
test();
// This is a function call (pass in $test)
test($test);
// This is another call to a function (test)
test();
// Don't forget to unset $user
unset($user);
// @see test()
test();
// @todo remove
$user = 1;