class documentation

class MessageDefinitionStore: (source)

View In Hierarchy

The messages store knows information about every possible message definition but has no particular state during analysis.

Method __init__ Undocumented
Method find_emittable_messages Finds all emittable and non-emittable messages.
Method get_message_definitions Returns the Message definition for either a numeric or symbolic id.
Method get_msg_display_string Generates a user-consumable representation of a message.
Method help_message Display help messages for the given message identifiers.
Method list_messages Output full messages list documentation in ReST format.
Method register_message Register a MessageDefinition with consistency in mind.
Method register_messages_from_checker Register all messages definitions from a checker.
Instance Variable message_id_store Undocumented
Instance Variable py_version Undocumented
Property messages The list of all active messages.
Instance Variable _messages_definitions Undocumented
Instance Variable _msgs_by_category Undocumented
def __init__(self, py_version: tuple[int, ...]|sys._version_info = sys.version_info): (source)

Undocumented

def find_emittable_messages(self) -> tuple[list[MessageDefinition], list[MessageDefinition]]: (source)

Finds all emittable and non-emittable messages.

@functools.lru_cache(maxsize=None)
def get_message_definitions(self, msgid_or_symbol: str) -> list[MessageDefinition]: (source)

Returns the Message definition for either a numeric or symbolic id. The cache has no limit as its size will likely stay minimal. For each message we store about 1000 characters, so even if we would have 1000 messages the cache would only take up ~= 1 Mb.

def get_msg_display_string(self, msgid_or_symbol: str) -> str: (source)

Generates a user-consumable representation of a message.

def help_message(self, msgids_or_symbols: Sequence[str]): (source)

Display help messages for the given message identifiers.

def list_messages(self): (source)

Output full messages list documentation in ReST format.

def register_message(self, message: MessageDefinition): (source)

Register a MessageDefinition with consistency in mind.

def register_messages_from_checker(self, checker: BaseChecker): (source)

Register all messages definitions from a checker.

message_id_store: MessageIdStore = (source)

Undocumented

py_version = (source)

Undocumented

@property
messages: ValuesView[MessageDefinition] = (source)

The list of all active messages.

_messages_definitions: dict[str, MessageDefinition] = (source)

Undocumented

_msgs_by_category: dict[str, list[str]] = (source)

Undocumented