class documentation

Checks use of the logging module.

Method visit_call Checks calls to logging methods.
Method visit_import Checks to see if this module uses Python's built-in logging.
Method visit_importfrom Checks to see if a module uses a non-Python logging module.
Method visit_module Clears any state left in this checker from last module checked.
Class Variable name Name of the provider.
Class Variable options Options provided by this provider.
Static Method _is_operand_literal_str Return True if the operand in argument is a literal string.
Method _check_call_func Checks that function call is not format_string.format().
Method _check_format_string Checks that format string tokens match the supplied arguments.
Method _check_log_method Checks calls to logging.log(level, format, *format_args).
Method _helper_string Create a string that lists the valid types of formatting for this node.
Instance Variable _format_style Undocumented
Instance Variable _from_imports Undocumented
Instance Variable _logging_modules Undocumented
Instance Variable _logging_names Undocumented

Inherited from BaseChecker:

Method __eq__ Permit to assert Checkers are equal.
Method __gt__ Sorting of checkers.
Method __hash__ Make Checker hashable.
Method __init__ Checker instances should have the linter as argument.
Method __repr__ Undocumented
Method __str__ This might be incomplete because multiple classes inheriting BaseChecker can have the same name.
Method add_message Undocumented
Method check_consistency Check the consistency of msgid.
Method close Called after visiting project (i.e set of modules).
Method create_message_definition_from_tuple Undocumented
Method get_full_documentation Undocumented
Method get_map_data Undocumented
Method get_message_definition Undocumented
Method open Called before visiting project (i.e. set of modules).
Method reduce_map_data Undocumented
Class Variable enabled Undocumented
Class Variable msgs Undocumented
Class Variable reports Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via BaseChecker):

Method get_option_def DEPRECATED: Return the dictionary defining an option given its name.
Method level.setter Undocumented
Method load_defaults DEPRECATED: Initialize the provider using default values.
Method option_attrname DEPRECATED: Get the config attribute corresponding to opt.
Method option_value DEPRECATED: Get the current value for the given option.
Method options_and_values DEPRECATED.
Method options_by_section DEPRECATED: Return an iterator on options grouped by section.
Method set_option DEPRECATED: Method called to set an option (registered in the options list).
Class Variable option_groups_descs Option groups of this provider and their descriptions.
Property config Undocumented
Property level Undocumented
Instance Variable _arguments_manager The manager that will parse and register any options provided.
Instance Variable _level Undocumented
def visit_call(self, node: nodes.Call): (source)

Checks calls to logging methods.

def visit_import(self, node: nodes.Import): (source)

Checks to see if this module uses Python's built-in logging.

def visit_importfrom(self, node: nodes.ImportFrom): (source)

Checks to see if a module uses a non-Python logging module.

def visit_module(self, _: nodes.Module): (source)

Clears any state left in this checker from last module checked.

Name of the provider.

options: tuple[tuple, ...] = (source)

Options provided by this provider.

@staticmethod
def _is_operand_literal_str(operand: InferenceResult|None) -> bool: (source)

Return True if the operand in argument is a literal string.

def _check_call_func(self, node: nodes.Call): (source)

Checks that function call is not format_string.format().

def _check_format_string(self, node: nodes.Call, format_arg: Literal[0, 1]): (source)

Checks that format string tokens match the supplied arguments. Args: node: AST node to be checked. format_arg: Index of the format string in the node arguments.

def _check_log_method(self, node: nodes.Call, name: str): (source)

Checks calls to logging.log(level, format, *format_args).

def _helper_string(self, node: nodes.Call) -> str: (source)

Create a string that lists the valid types of formatting for this node.

_format_style = (source)

Undocumented

_from_imports: dict = (source)

Undocumented

_logging_modules = (source)

Undocumented

_logging_names: set[str] = (source)

Undocumented