summaryrefslogtreecommitdiff
path: root/pylint/message/message_definition.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2019-06-25 23:25:02 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2019-08-16 17:25:23 +0200
commitbd24f94c77c9c9c81d86d098936645b8c0de3bf3 (patch)
tree1938a9e4fb9f1bb5aa187ab5fe9ffddc78a7ae7d /pylint/message/message_definition.py
parent43792243f4cc9d79d3b653aee2de2e8ba37f8d77 (diff)
downloadpylint-git-bd24f94c77c9c9c81d86d098936645b8c0de3bf3.tar.gz
[pylint.message] Symbol seems to never be None anymore
Diffstat (limited to 'pylint/message/message_definition.py')
-rw-r--r--pylint/message/message_definition.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/pylint/message/message_definition.py b/pylint/message/message_definition.py
index 2d8cd2997..cd33cd575 100644
--- a/pylint/message/message_definition.py
+++ b/pylint/message/message_definition.py
@@ -29,12 +29,9 @@ class MessageDefinition:
if not msgid[0] in MSG_TYPES:
raise InvalidMessageError("Bad message type %s in %r" % (msgid[0], msgid))
self.msgid = msgid
+ self.symbol = symbol
self.msg = msg
self.description = description
- if not symbol:
- # backward compatibility, message may not have a symbol
- symbol = msgid
- self.symbol = symbol
self.scope = scope
self.minversion = minversion
self.maxversion = maxversion
@@ -60,10 +57,6 @@ class MessageDefinition:
if checkerref:
desc += " This message belongs to the %s checker." % self.checker.name
title = self.msg
- if self.symbol:
- msgid = "%s (%s)" % (self.symbol, self.msgid)
- else:
- msgid = self.msgid
if self.minversion or self.maxversion:
restr = []
if self.minversion:
@@ -75,9 +68,9 @@ class MessageDefinition:
desc += " It can't be emitted when using Python %s." % restr
else:
desc += " This message can't be emitted when using Python %s." % restr
- desc = normalize_text(" ".join(desc.split()), indent=" ")
+ msg_help = normalize_text(" ".join(desc.split()), indent=" ")
+ message_id = "%s (%s)" % (self.symbol, self.msgid)
if title != "%s":
title = title.splitlines()[0]
-
- return ":%s: *%s*\n%s" % (msgid, title.rstrip(" "), desc)
- return ":%s:\n%s" % (msgid, desc)
+ return ":%s: *%s*\n%s" % (message_id, title.rstrip(" "), msg_help)
+ return ":%s:\n%s" % (message_id, msg_help)