diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-31 00:16:17 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-31 00:16:17 +0300 |
commit | 63a8818f768fed20c661c9575a5b535ff34b5903 (patch) | |
tree | 7ff402c2cfe0af19e7755ca9cdcde368f5aabcae /pylint/utils.py | |
parent | 40a48529753727b1af6836bef2447c0d413d78b6 (diff) | |
download | pylint-63a8818f768fed20c661c9575a5b535ff34b5903.tar.gz |
--generate-rcfile generates by default human readable symbols for the --disable option. Closes issue #608.
Diffstat (limited to 'pylint/utils.py')
-rw-r--r-- | pylint/utils.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pylint/utils.py b/pylint/utils.py index d2c9ed8..8870ec6 100644 --- a/pylint/utils.py +++ b/pylint/utils.py @@ -277,10 +277,22 @@ class MessagesHandlerMixIn(object): else: msgs = self._msgs_state msgs[msg.msgid] = False - # sync configuration object - self.config.disable = [mid for mid, val in six.iteritems(msgs) + # sync configuration object + self.config.disable = [self._message_symbol(mid) + for mid, val in six.iteritems(msgs) if not val] + def _message_symbol(self, msgid): + """Get the message symbol of the given message id + + Return the original message id if the message does not + exist. + """ + try: + return self.msgs_store.check_message_id(msgid).symbol + except UnknownMessage: + return msgid + def enable(self, msgid, scope='package', line=None, ignore_unknown=False): """reenable message of the given id""" assert scope in ('package', 'module') |