[code-quality] [pylint] disabled messages with --errors-only

Tim Stumbaugh stum at hudson-trading.com
Wed Jul 20 13:20:14 EDT 2016


Hi,

Since command line flags are processed after config file directives, error
messages that are disabled in a config file (or in a command line flag that
appears before --errors-only) are not respected when running in errors-only
mode.

This appears to be because errors-only mode unconditionally enables all
messages with a category of 'E' or 'F'.

We have a config file that has the messages that has a few error messages
disabled (because of highly-dynamic features that we use that pylint can't
interpret correctly), but we do run pylint in errors-only mode quite often.

A patch that works for us is to change PyLinter.disable_noerror_messages
not to ever enable messages (but only to disable non error messages). That
seems like quite a large change though, since a user who only passes
--enable (or enables messages through the config file) would not get
messages in --errors-only that they haven't asked for.

Is there an opinion on what patch might be acceptable for the project?
Would it work to add an extra flag or put extra state in the PyLinter
object so that it knows which messages have been explicitly disabled?

Thanks,
tjs

-- 
Tim Stumbaugh
Operations
Hudson River Trading
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20160720/04f3a17f/attachment.html>


More information about the code-quality mailing list