Hi,

In #1772676: How to "ignore" warnings it is explained how to ignore a rule, putting the comment // @ignore rule_name before it.

How to figure out the rule name we want to ignore?

For example, let's say I don't want the following code to generate a security warning:

      // @ignore security
      drupal_set_message(t($message['message'], $message['args']), 'status', FALSE);

I was under the impression that the line // @ignore security would prevent the warning from showing up, yet it still does.

Any suggestions would be welcome, thanks!

Albert

Comments

douggreen’s picture

The rule name is displayed in the output. In the GUI it's at the end of the warning message. In drush, it's at the beginning of the line. You probably want

<?php
      // @ignore security_3
      drupal_set_message(t($message['message'], $message['args']), 'status', FALSE);

Beware that the coder ignore system is new, and some of the warning names may still change.

alberto56’s picture

Title: Where can I find "rule names" in order to ignore them? » Document the feature to ignore warnings
Category: support » task

Hi, thanks for the response.

I'm not sure where I can find "security_3". In my case it is neither in the GUI nor in the drush printout. Also, // @ignore security_3 does not ignore the following line.

Perhaps some documentation on this, with examples, is needed.

Cheers,

Albert.

alberto56’s picture

Title: Document the feature to ignore warnings » Put the 2.x-dev snapshot on the project homepage
StatusFileSize
new117.25 KB

OK, found it!

The enclosed image shows how to find the code. I was using 7.x-1.x-dev and not 7.x-2.x-dev, that's why I was not finding. Perhaps putting the 7.x-2.x-dev snapshot on the project homepage might help other version-challenged users such as myself.

Thanks,

Albert.

klausi’s picture

Yep, now that drupalcs has been merged into this project it would be cool to make this available to a broader user base with development snapshots.

douggreen’s picture

Status: Active » Fixed

Thanks, it's there now, sorry I forgot to do this earlier. We are actually close to a 7.x-2.1-RC1 release.

Status: Fixed » Closed (fixed)

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