summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-07-31 00:16:17 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-07-31 00:16:17 +0300
commit63a8818f768fed20c661c9575a5b535ff34b5903 (patch)
tree7ff402c2cfe0af19e7755ca9cdcde368f5aabcae /pylint/utils.py
parent40a48529753727b1af6836bef2447c0d413d78b6 (diff)
downloadpylint-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.py16
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')