class documentation

class UnittestLinter(PyLinter): (source)

View In Hierarchy

A fake linter class to capture checker messages.

Static Method is_message_enabled Return whether this message is enabled for the current file, line and confidence level.
Method __init__ Undocumented
Method add_message Add a MessageTest to the _messages attribute of the linter class.
Method release_messages Undocumented
Instance Variable _messages Undocumented

Inherited from PyLinter:

Static Method should_analyze_file Returns whether a module should be checked.
Method add_ignored_message Prepares a message to be added to the ignored message storage.
Method any_fail_on_issues Undocumented
Method check Main checking entry: check a list of files or modules from their name.
Method check_astroid_module Check a module from its astroid representation.
Method check_single_file Undocumented
Method check_single_file_item Check single file item.
Method disable_reporters Disable all reporters.
Method enable_fail_on_messages Enable 'fail on' msgs.
Method generate_reports Close the whole package /module, it's time to make reports !
Method get_ast Return an ast(roid) representation of a module or a string.
Method get_checker_names Get all the checker names that this linter knows about.
Method get_checkers Return all available checkers as an ordered list.
Method initialize Initialize linter for linting.
Method load_default_plugins Undocumented
Method load_plugin_configuration Call the configuration hook for plugins.
Method load_plugin_modules Check a list of pylint plugins modules, load and register them.
Method open Initialize counters.
Method option_groups.setter Undocumented
Method prepare_checkers Return checkers needed for activated messages and reports.
Method register_checker This method auto registers the checker.
Method register_reporter Registers a reporter class on the _reporters attribute.
Method report_order Return a list of reporters.
Method set_current_module Set the name of the currently analyzed module and init statistics for it.
Method set_reporter Set the reporter used to display messages and reports.
Class Variable crash_file_path Undocumented
Class Variable option_groups_descs Undocumented
Instance Variable config Undocumented
Instance Variable current_file Undocumented
Instance Variable current_name Undocumented
Instance Variable fail_on_symbols List of message symbols on which pylint should fail, set by --fail-on.
Instance Variable file_state Undocumented
Instance Variable msg_status Undocumented
Instance Variable msgs_store Undocumented
Instance Variable options Undocumented
Instance Variable reporter Undocumented
Instance Variable reports Undocumented
Instance Variable stats Undocumented
Property option_groups Undocumented
Method _add_one_message After various checks have passed a single Message is passed to the reporter and added to stats.
Method _astroid_module_checker Context manager for checking ASTs.
Method _check_astroid_module Check given AST node with given walker and checkers.
Method _check_file Check a file using the passed utility functions (get_ast and check_astroid_module).
Method _discover_files Discover python modules and packages in sub-directory.
Method _emit_stashed_messages Undocumented
Method _expand_files Get modules and errors from a list of modules and handle errors.
Method _get_asts Get the AST for all given FileItems.
Method _get_file_descr_from_stdin Return file description (tuple of module name, file path, base name) from given file path.
Method _get_namespace_for_file Undocumented
Method _iterate_file_descrs Return generator yielding file descriptions (tuples of module name, file path, base name).
Method _lint_file Lint a file using the passed utility function check_astroid_module).
Method _lint_files Lint all AST modules from a mapping..
Method _load_reporter_by_name Undocumented
Method _load_reporters Load the reporters if they are available on _reporters.
Method _parse_error_mode Parse the current state of the error mode.
Method _report_evaluation Make the global evaluation report.
Instance Variable _by_id_managed_msgs Undocumented
Instance Variable _checkers Dictionary of registered and initialized checkers.
Instance Variable _dynamic_plugins Set of loaded plugin names.
Instance Variable _error_mode Undocumented
Instance Variable _ignore_file Undocumented
Instance Variable _ignore_paths Undocumented
Instance Variable _option_groups Undocumented
Instance Variable _reporters Dictionary of possible but non-initialized reporters.
Instance Variable _stashed_messages 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_next Disable a message for the next line.
Method disable_noerror_messages Disable message categories other than `error` and `fatal`.
Method enable Enable a message for a scope.
Method list_messages_enabled Undocumented
Method process_tokens Process tokens from the current module to search for module/block level options.
Instance Variable linter Undocumented
Method _get_message_state_scope Returns the scope at which a message was enabled/disabled.
Method _get_messages_to_set Do some tests and find the actual messages of which the status should be set.
Method _is_one_message_enabled Checks state of a single message for the current file.
Method _register_by_id_managed_msg If the msgid is a numeric one, then register it to inform the user it could furnish instead a symbolic msgid.
Method _set_msg_status Do some tests and then iterate over message definitions to set state.
Method _set_one_msg_status Set the status of an individual message.
Instance Variable _bw_options_methods Undocumented
Instance Variable _msgs_state Undocumented
Instance Variable _options_methods Undocumented
Instance Variable _pragma_lineno Undocumented

Inherited from ReportsHandlerMixIn (via PyLinter, _MessageStateHandler):

Method disable_report Disable the report of the given id.
Method enable_report Enable the report of the given id.
Method make_reports Render registered reports.
Method register_report Register a report.
Method report_is_enabled Is the report associated to the given identifier enabled ?
Instance Variable _reports Undocumented
Instance Variable _reports_state Undocumented
@staticmethod
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

def __init__(self): (source)

Undocumented

def add_message(self, msgid: 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)

Add a MessageTest to the _messages attribute of the linter class.

def release_messages(self) -> list[MessageTest]: (source)

Undocumented

Undocumented