Problem/Motivation

Per Doxygen and comment formatting conventions for documenting hook implementations and theme preprocess functions, hook implementations can also refer to a template file, e.g. Implements hook_foo_BAR_ID_bar() for xyz_bar.tpl.php. (See #1443202: Apply documentation standards for hook_preprocess_HOOK() for examples.) The function comment sniff therefore needs to support the additional option.

Proposed resolution

Expand the regex to support the additional option.

Remaining tasks

Test and commit the patch.

Original report by Lars Toomre

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

Format should be "* Implements hook_foo()." or "Implements hook_foo_BAR_ID_bar() for xyz_bar()."
* Implements hook_preprocess_HOOK() for block.tpl.php.

We should also file an issue with Coder for this one, because "for *.tpl.php" is acceptable syntax for this.

This is an issue to address this false positive sniff.

Comments

traviscarden’s picture

Component: Coder Review » Code Sniffer
Status: Active » Needs review
StatusFileSize
new1.2 KB

This should do the trick.

klausi’s picture

Status: Needs review » Needs work

Needs an example Tests/good.php.

traviscarden’s picture

Status: Needs work » Needs review
StatusFileSize
new1.73 KB

Sure. How 'bout this?

yesct’s picture

Component: Code Sniffer » Coder Review

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)

Maybe this manual test contributor task doc might inspire someone new to jump in...
http://drupal.org/node/1489010

klausi’s picture

Status: Needs review » Fixed

Committed, thanks!

yesct’s picture

:) that was quick!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.