class documentation
class FileState: (source)
Hold internal state specific to the currently analyzed file.
Method | __init__ |
Undocumented |
Method | collect |
Walk the AST to collect block level options line numbers. |
Method | get |
Undocumented |
Method | handle |
Report an ignored message. |
Method | iter |
Undocumented |
Method | set |
Set status (enabled/disable) for a given message at a given line. |
Instance Variable | base |
Undocumented |
Method | _set |
Set the state of a message in a block of lines. |
Method | _set |
Set the state of a message on a line. |
Method | _set |
Recursively walk (depth first) AST to collect block level options line numbers and set the state correctly. |
Instance Variable | _effective |
Undocumented |
Instance Variable | _ignored |
Undocumented |
Instance Variable | _is |
If this FileState is the base state made during initialization of PyLinter. |
Instance Variable | _module |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _msgs |
Undocumented |
Instance Variable | _raw |
Undocumented |
Instance Variable | _suppression |
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 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.
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.