Class that handles message disabling & enabling and processing of inline pragma's.
Method | __init__ |
Undocumented |
Method | disable |
Disable a message for a scope. |
Method | disable |
Disable a message for the next line. |
Method | disable |
Disable message categories other than `error` and `fatal`. |
Method | enable |
Enable a message for a scope. |
Method | is |
Return whether this message is enabled for the current file, line and confidence level. |
Method | list |
Undocumented |
Method | process |
Process tokens from the current module to search for module/block level options. |
Instance Variable | linter |
Undocumented |
Method | _get |
Returns the scope at which a message was enabled/disabled. |
Method | _get |
Do some tests and find the actual messages of which the status should be set. |
Method | _is |
Checks state of a single message for the current file. |
Method | _register |
If the msgid is a numeric one, then register it to inform the user it could furnish instead a symbolic msgid. |
Method | _set |
Do some tests and then iterate over message definitions to set state. |
Method | _set |
Set the status of an individual message. |
Instance Variable | _bw |
Undocumented |
Instance Variable | _ignore |
Undocumented |
Instance Variable | _msgs |
Undocumented |
Instance Variable | _options |
Undocumented |
Instance Variable | _pragma |
Undocumented |
Instance Variable | _stashed |
Some messages in the options (for --enable and --disable) are encountered too early to warn about them. |
str
, scope: str
= 'package', line: int|None
= None, ignore_unknown: bool
= False):
(source)
¶
Disable a message for a scope.
str
, _: str
= 'package', line: int|None
= None, ignore_unknown: bool
= False):
(source)
¶
Disable a message for the next line.
str
, scope: str
= 'package', line: int|None
= None, ignore_unknown: bool
= False):
(source)
¶
Enable a message for a scope.
str
, line: int|None
= None, confidence: interfaces.Confidence|None
= None) -> bool
:
(source)
¶
pylint.testutils.UnittestLinter
Return whether this message is enabled for the current file, line and confidence level. This function can't be cached right now as the line is the line of the currently analysed file (self.file_state), if it changes, then the result for the same msg_descr/line might need to change. :param msg_descr: Either the msgid or the symbol for a MessageDefinition :param line: The line of the currently analysed file :param confidence: The confidence of the message
Process tokens from the current module to search for module/block level options. See func_block_disable_msg.py test case for expected behaviour.
str
, line: int|None
= None, confidence: interfaces.Confidence|None
= None) -> Literal[ 0, 1, 2]|None
:
(source)
¶
Returns the scope at which a message was enabled/disabled.
str
, enable: bool
, ignore_unknown: bool
= False) -> list[ MessageDefinition]
:
(source)
¶
Do some tests and find the actual messages of which the status should be set.
Checks state of a single message for the current file. This function can't be cached as it depends on self.file_state which can change.
str
, line: int|None
, is_disabled: bool
= True):
(source)
¶
If the msgid is a numeric one, then register it to inform the user it could furnish instead a symbolic msgid.
str
, enable: bool
, scope: str
= 'package', line: int|None
= None, ignore_unknown: bool
= False):
(source)
¶
Do some tests and then iterate over message definitions to set state.
str
, msg: MessageDefinition
, line: int|None
, enable: bool
):
(source)
¶
Set the status of an individual message.
pylint.lint.PyLinter
Some messages in the options (for --enable and --disable) are encountered too early to warn about them. i.e. before all option providers have been fully parsed. Thus, this dict stores option_value and msg_id needed to (later) emit the messages keyed on module names.