Skip to content

Commit e815843

Browse files
Get the msgid directly from the MessageIdStore (#5606)
We don't need to create message definitions to get their msgids. The level of indirection may suggest we need to refactor a little here. Maybe we actually need message definition only when we want to display the messages. Here's the current implementation of get_message_definitions: def get_message_definitions(self, msgid_or_symbol: str) -> List[MessageDefinition]: """Returns the Message definition for either a numeric or symbolic id.""" return [ self._messages_definitions[m] for m in self.message_id_store.get_active_msgids(msgid_or_symbol) ]
1 parent f56db7d commit e815843

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pylint/lint/pylinter.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,7 @@ def is_message_enabled(
14351435
if confidence.name not in self.config.confidence:
14361436
return False
14371437
try:
1438-
message_definitions = self.msgs_store.get_message_definitions(msg_descr)
1439-
msgids = [md.msgid for md in message_definitions]
1438+
msgids = self.msgs_store.message_id_store.get_active_msgids(msg_descr)
14401439
except exceptions.UnknownMessageError:
14411440
# The linter checks for messages that are not registered
14421441
# due to version mismatch, just treat them as message IDs

0 commit comments

Comments
 (0)