class UnittestLinter(PyLinter): (source)
A fake linter class to capture checker messages.
Static Method | is |
Return whether this message is enabled for the current file, line and confidence level. |
Method | __init__ |
Undocumented |
Method | add |
Add a MessageTest to the _messages attribute of the linter class. |
Method | release |
Undocumented |
Instance Variable | _messages |
Undocumented |
Inherited from PyLinter
:
Static Method | should |
Returns whether a module should be checked. |
Method | add |
Prepares a message to be added to the ignored message storage. |
Method | any |
Undocumented |
Method | check |
Main checking entry: check a list of files or modules from their name. |
Method | check |
Check a module from its astroid representation. |
Method | check |
Undocumented |
Method | check |
Check single file item. |
Method | disable |
Disable all reporters. |
Method | enable |
Enable 'fail on' msgs. |
Method | generate |
Close the whole package /module, it's time to make reports ! |
Method | get |
Return an ast(roid) representation of a module or a string. |
Method | get |
Get all the checker names that this linter knows about. |
Method | get |
Return all available checkers as an ordered list. |
Method | initialize |
Initialize linter for linting. |
Method | load |
Undocumented |
Method | load |
Call the configuration hook for plugins. |
Method | load |
Check a list of pylint plugins modules, load and register them. |
Method | open |
Initialize counters. |
Method | option |
Undocumented |
Method | prepare |
Return checkers needed for activated messages and reports. |
Method | register |
This method auto registers the checker. |
Method | register |
Registers a reporter class on the _reporters attribute. |
Method | report |
Return a list of reporters. |
Method | set |
Set the name of the currently analyzed module and init statistics for it. |
Method | set |
Set the reporter used to display messages and reports. |
Class Variable | crash |
Undocumented |
Class Variable | option |
Undocumented |
Instance Variable | config |
Undocumented |
Instance Variable | current |
Undocumented |
Instance Variable | current |
Undocumented |
Instance Variable | fail |
List of message symbols on which pylint should fail, set by --fail-on. |
Instance Variable | file |
Undocumented |
Instance Variable | msg |
Undocumented |
Instance Variable | msgs |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | reporter |
Undocumented |
Instance Variable | reports |
Undocumented |
Instance Variable | stats |
Undocumented |
Property | option |
Undocumented |
Method | _add |
After various checks have passed a single Message is passed to the reporter and added to stats. |
Method | _astroid |
Context manager for checking ASTs. |
Method | _check |
Check given AST node with given walker and checkers. |
Method | _check |
Check a file using the passed utility functions (get_ast and check_astroid_module). |
Method | _discover |
Discover python modules and packages in sub-directory. |
Method | _emit |
Undocumented |
Method | _expand |
Get modules and errors from a list of modules and handle errors. |
Method | _get |
Get the AST for all given FileItems. |
Method | _get |
Return file description (tuple of module name, file path, base name) from given file path. |
Method | _get |
Undocumented |
Method | _iterate |
Return generator yielding file descriptions (tuples of module name, file path, base name). |
Method | _lint |
Lint a file using the passed utility function check_astroid_module). |
Method | _lint |
Lint all AST modules from a mapping.. |
Method | _load |
Undocumented |
Method | _load |
Load the reporters if they are available on _reporters. |
Method | _parse |
Parse the current state of the error mode. |
Method | _report |
Make the global evaluation report. |
Instance Variable | _by |
Undocumented |
Instance Variable | _checkers |
Dictionary of registered and initialized checkers. |
Instance Variable | _dynamic |
Set of loaded plugin names. |
Instance Variable | _error |
Undocumented |
Instance Variable | _ignore |
Undocumented |
Instance Variable | _ignore |
Undocumented |
Instance Variable | _option |
Undocumented |
Instance Variable | _reporters |
Dictionary of possible but non-initialized reporters. |
Instance Variable | _stashed |
Some messages in the options (for --enable and --disable) are encountered too early to warn about them. |
Inherited from _MessageStateHandler
(via PyLinter
):
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 | 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 | _msgs |
Undocumented |
Instance Variable | _options |
Undocumented |
Instance Variable | _pragma |
Undocumented |
Inherited from ReportsHandlerMixIn
(via PyLinter
, _MessageStateHandler
):
Method | disable |
Disable the report of the given id. |
Method | enable |
Enable the report of the given id. |
Method | make |
Render registered reports. |
Method | register |
Register a report. |
Method | report |
Is the report associated to the given identifier enabled ? |
Instance Variable | _reports |
Undocumented |
Instance Variable | _reports |
Undocumented |
def is_message_enabled(*unused_args:
Any
, **unused_kwargs: Any
) -> Literal[ True]
:
(source)
¶
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
str
, line: int|None
= None, node: nodes.NodeNG|None
= None, args: Any
= None, confidence: Confidence|None
= None, col_offset: int|None
= None, end_lineno: int|None
= None, end_col_offset: int|None
= None):
(source)
¶
pylint.lint.PyLinter.add_message
Add a MessageTest to the _messages attribute of the linter class.