There's a t() call on a menu item title in the invite module, line 147, which coder isn't catching. Logging this for closer investigation.

Stella

CommentFileSizeAuthor
#2 coder_drush_314313.patch823 bytesstella

Comments

stella’s picture

This is actually only not reported on when running coder using drush. If you run it through the UI it works perfectly.

stella’s picture

Title: not catching t() on menu title in invite module » coder + drush error when using 'no-empty'
Component: Review/Rules » Code
Status: Active » Needs review
StatusFileSize
new823 bytes

If you run coder reviews using the drush command line method and are providing it with the 'no-empty' option, then if there is only one error reported in the module, it won't be displayed. For example, if you run it on the invite module like this:

drush coder minor i18n no-empty invite

Then no results are returned. If you run it without the "no-empty" option, you get one result:

sites/sony/modules/contrib-6--2/invite/invite.module:
 +147: Menu item titles and descriptions should NOT be enclosed within t().

sites/sony/modules/contrib-6--2/invite/invite.install:
 No Problems Found

sites/sony/modules/contrib-6--2/invite/invite_admin.inc:
 No Problems Found

sites/sony/modules/contrib-6--2/invite/invite_token.inc:
 No Problems Found

It's to do with the check on the number of results returned on line 117 of coder.drush.inc:

if (!_coder_drush_is_option('summary') && !empty($results) && (count($results) > 1 || !_coder_drush_is_option('no-empty'))) {

For cases where no problems were found, there is still one entry in the $results array for the "No problems found" text. However if 1 problem was found, then there's still one entry in the $results array and the above line prevents it from being displayed.

The attached patch should fix this.

Cheers,
Stella

douggreen’s picture

@stella, if this fixes it, please commit it. Thanks!

stella’s picture

Status: Needs review » Fixed

Committed to the DRUPAL-6--2 branch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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