Many of Drush's hooks are prefixed with "drush_hook" rather than just "hook_"—drush_hook_COMMAND_pre_validate(), for example—so their docblocks get flagged because the "Implements hook_foo()" regex doesn't support that variation. T'would be nice if it weren't so. :) Patch to follow.

Comments

traviscarden’s picture

Assigned: traviscarden » Unassigned
Status: Active » Needs review
StatusFileSize
new1.21 KB

I don't really know what's being done for automated testing for Coder Sniffer, so I took a stab what seemed obvious.

traviscarden’s picture

Issue summary: View changes

Updated issue summary.

traviscarden’s picture

Issue summary: View changes
StatusFileSize
new1.53 KB

Reroll.

owen barton’s picture

The patch is reversed, but otherwise I think this looks good.

If we wanted to get more precise we could check for drush hooks only in *.drush.inc files (splitting Drush functions out like this is a best practice, I feel), but that is pretty minor.

traviscarden’s picture

StatusFileSize
new1.53 KB

Oops! Thanks for the catch on the reversed patch, @Owen Barton. Here's a better one.

I agree it would be nice to restrict Drush hooks to *.drush.inc files, but that kind of feels like something for a new, separate sniff--maybe as a follow-up to this one?

owen barton’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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