class documentation

Undocumented

Method __init__ Checker instances should have the linter as argument.
Method deprecated_arguments Callback returning the deprecated arguments of method/function.
Method deprecated_classes Callback returning the deprecated classes of module.
Method deprecated_decorators Callback returning the deprecated decorators.
Method deprecated_methods Callback returning the deprecated methods/functions.
Method visit_boolop Undocumented
Method visit_call Visit a Call node.
Method visit_functiondef Undocumented
Method visit_if Undocumented
Method visit_ifexp Undocumented
Method visit_unaryop Undocumented
Class Variable msgs Undocumented
Class Variable name Name of the provider.
Method _check_bad_thread_instantiation Undocumented
Method _check_datetime Check that a datetime was inferred, if so, emit boolean-datetime warning.
Method _check_dispatch_decorators Undocumented
Method _check_env_function Undocumented
Method _check_for_check_kw_in_run Undocumented
Method _check_for_preexec_fn_in_popen Undocumented
Method _check_invalid_envvar_value Undocumented
Method _check_lru_cache_decorators Check if instance methods are decorated with functools.lru_cache.
Method _check_open_call Various checks for an open call.
Method _check_redundant_assert Undocumented
Method _check_shallow_copy_environ Undocumented
Instance Variable _deprecated_arguments Undocumented
Instance Variable _deprecated_classes Undocumented
Instance Variable _deprecated_decorators Undocumented
Instance Variable _deprecated_methods Undocumented

Inherited from DeprecatedMixin:

Method check_deprecated_class Checks if the class is deprecated.
Method check_deprecated_class_in_call Checks if call the deprecated class.
Method check_deprecated_method Executes the checker for the given node.
Method check_deprecated_module Checks if the module is deprecated.
Method deprecated_modules Callback returning the deprecated modules.
Method visit_decorators Triggered when a decorator statement is seen.
Method visit_import Triggered when an import statement is seen.
Method visit_importfrom Triggered when a from statement is seen.
Constant DEPRECATED_ARGUMENT_MESSAGE Undocumented
Constant DEPRECATED_CLASS_MESSAGE Undocumented
Constant DEPRECATED_DECORATOR_MESSAGE Undocumented
Constant DEPRECATED_METHOD_MESSAGE Undocumented
Constant DEPRECATED_MODULE_MESSAGE Undocumented

Inherited from BaseChecker (via DeprecatedMixin):

Method __eq__ Permit to assert Checkers are equal.
Method __gt__ Sorting of checkers.
Method __hash__ Make Checker hashable.
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 options Options provided by this provider.
Class Variable reports Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via DeprecatedMixin, 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 __init__(self, linter: PyLinter): (source)

Checker instances should have the linter as argument.

def deprecated_arguments(self, method: str) -> tuple[tuple[int|None, str], ...]: (source)

Callback returning the deprecated arguments of method/function. Args: method (str): name of function/method checked for deprecated arguments Returns: collections.abc.Iterable in form: ((POSITION1, PARAM1), (POSITION2: PARAM2) ...) where * POSITIONX - position of deprecated argument PARAMX in function definition. If argument is keyword-only, POSITIONX should be None. * PARAMX - name of the deprecated argument. E.g. suppose function: .. code-block:: python def bar(arg1, arg2, arg3, arg4, arg5='spam') with deprecated arguments `arg2` and `arg4`. `deprecated_arguments` should return: .. code-block:: python ((1, 'arg2'), (3, 'arg4'))

def deprecated_classes(self, module: str) -> Iterable[str]: (source)

Callback returning the deprecated classes of module. Args: module (str): name of module checked for deprecated classes Returns: collections.abc.Container of deprecated class names.

def deprecated_decorators(self) -> Iterable[str]: (source)

Callback returning the deprecated decorators. Returns: collections.abc.Container of deprecated decorator names.

def deprecated_methods(self) -> set[str]: (source)

Callback returning the deprecated methods/functions. Returns: collections.abc.Container of deprecated function/method names.

@utils.only_required_for_messages('boolean-datetime')
def visit_boolop(self, node: nodes.BoolOp): (source)

Undocumented

@utils.only_required_for_messages('bad-open-mode', 'redundant-unittest-assert', 'deprecated-method', 'deprecated-argument', 'bad-thread-instantiation', 'shallow-copy-environ', 'invalid-envvar-value', 'invalid-envvar-default', 'subprocess-popen-preexec-fn', 'subprocess-run-check', 'deprecated-class', 'unspecified-encoding', 'forgotten-debug-statement')
def visit_call(self, node: nodes.Call): (source)

Visit a Call node.

@utils.only_required_for_messages('method-cache-max-size-none', 'singledispatch-method', 'singledispatchmethod-function')
def visit_functiondef(self, node: nodes.FunctionDef): (source)

Undocumented

@utils.only_required_for_messages('boolean-datetime')
def visit_if(self, node: nodes.If): (source)

Undocumented

@utils.only_required_for_messages('boolean-datetime')
def visit_ifexp(self, node: nodes.IfExp): (source)

Undocumented

@utils.only_required_for_messages('boolean-datetime')
def visit_unaryop(self, node: nodes.UnaryOp): (source)

Undocumented

Name of the provider.

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

Undocumented

def _check_datetime(self, node: nodes.NodeNG): (source)

Check that a datetime was inferred, if so, emit boolean-datetime warning.

def _check_dispatch_decorators(self, node: nodes.FunctionDef): (source)

Undocumented

def _check_env_function(self, node: nodes.Call, infer: nodes.FunctionDef): (source)

Undocumented

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

Undocumented

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

Undocumented

def _check_invalid_envvar_value(self, node: nodes.Call, infer: nodes.FunctionDef, message: str, call_arg: InferenceResult|None, allow_none: bool): (source)

Undocumented

def _check_lru_cache_decorators(self, node: nodes.FunctionDef): (source)

Check if instance methods are decorated with functools.lru_cache.

def _check_open_call(self, node: nodes.Call, open_module: str, func_name: str): (source)

Various checks for an open call.

def _check_redundant_assert(self, node: nodes.Call, infer: InferenceResult): (source)

Undocumented

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

Undocumented

_deprecated_arguments: dict[str, tuple[tuple[int|None, str], ...]] = (source)

Undocumented

_deprecated_classes: dict[str, set[str]] = (source)

Undocumented

_deprecated_decorators: set[str] = (source)

Undocumented

_deprecated_methods: set[str] = (source)

Undocumented