class documentation

class FileState: (source)

View In Hierarchy

Hold internal state specific to the currently analyzed file.

Method __init__ Undocumented
Method collect_block_lines Walk the AST to collect block level options line numbers.
Method get_effective_max_line_number Undocumented
Method handle_ignored_message Report an ignored message.
Method iter_spurious_suppression_messages Undocumented
Method set_msg_status Set status (enabled/disable) for a given message at a given line.
Instance Variable base_name Undocumented
Method _set_message_state_in_block Set the state of a message in a block of lines.
Method _set_message_state_on_line Set the state of a message on a line.
Method _set_state_on_block_lines Recursively walk (depth first) AST to collect block level options line numbers and set the state correctly.
Instance Variable _effective_max_line_number Undocumented
Instance Variable _ignored_msgs Undocumented
Instance Variable _is_base_filestate If this FileState is the base state made during initialization of PyLinter.
Instance Variable _module Undocumented
Instance Variable _module_msgs_state Undocumented
Instance Variable _msgs_store Undocumented
Instance Variable _raw_module_msgs_state Undocumented
Instance Variable _suppression_mapping Undocumented
def __init__(self, modname: str|None = None, msg_store: MessageDefinitionStore|None = None, node: nodes.Module|None = None, *, is_base_filestate: bool = False): (source)

Undocumented

def collect_block_lines(self, msgs_store: MessageDefinitionStore, module_node: nodes.Module): (source)

Walk the AST to collect block level options line numbers.

def get_effective_max_line_number(self) -> int|None: (source)

Undocumented

def handle_ignored_message(self, state_scope: Literal[0, 1, 2]|None, msgid: str, line: int|None): (source)

Report an ignored message. state_scope is either MSG_STATE_SCOPE_MODULE or MSG_STATE_SCOPE_CONFIG, depending on whether the message was disabled locally in the module, or globally.

def iter_spurious_suppression_messages(self, msgs_store: MessageDefinitionStore) -> Iterator[tuple[Literal['useless-suppression', 'suppressed-message'], int, tuple[str]|tuple[str, int]]]: (source)

Undocumented

def set_msg_status(self, msg: MessageDefinition, line: int, status: bool, scope: str = 'package'): (source)

Set status (enabled/disable) for a given message at a given line.

base_name = (source)

Undocumented

def _set_message_state_in_block(self, msg: MessageDefinition, lines: dict[int, bool], node: nodes.NodeNG, firstchildlineno: int): (source)

Set the state of a message in a block of lines.

def _set_message_state_on_line(self, msg: MessageDefinition, line: int, state: bool, original_lineno: int): (source)

Set the state of a message on a line.

def _set_state_on_block_lines(self, msgs_store: MessageDefinitionStore, node: nodes.NodeNG, msg: MessageDefinition, msg_state: dict[int, bool]): (source)

Recursively walk (depth first) AST to collect block level options line numbers and set the state correctly.

_effective_max_line_number = (source)

Undocumented

_ignored_msgs: defaultdict[tuple[str, int], set[int]] = (source)

Undocumented

_is_base_filestate = (source)

If this FileState is the base state made during initialization of PyLinter.

Undocumented

_module_msgs_state: dict = (source)

Undocumented

_msgs_store = (source)

Undocumented

_raw_module_msgs_state: MessageStateDict = (source)

Undocumented

_suppression_mapping: dict = (source)

Undocumented