class BasicChecker(_BasicChecker): (source)
Basic checker. Checks for : * doc strings * number of arguments, local variables, branches, returns and statements in functions, methods * required module attributes * dangerous default values as arguments * redefinition of function / method / class * uses of the global statement
Method | __init__ |
Checker instances should have the linter as argument. |
Method | leave |
Update try...finally flag. |
Method | open |
Initialize visit variables and statistics. |
Method | visit |
Check whether assert is used on a tuple or string literal. |
Method | visit |
Undocumented |
Method | visit |
Break node visitor. |
Method | visit |
Visit a Call node. |
Method | visit |
Check module name, docstring and redefinition increment branch counter. |
Method | visit |
Undocumented |
Method | visit |
Check is the node has a right sibling (if so, that's some unreachable code). |
Method | visit |
Check duplicate key in dictionary. |
Method | visit |
Check for various kind of statements without effect. |
Method | visit |
Undocumented |
Method | visit |
Check function name, docstring, arguments, redefinition, variable names, max locals. |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Check whether the lambda is suspicious. |
Method | visit |
Check module name, docstring and required arguments. |
Method | visit |
Check if the node has a right sibling (if so, that's some unreachable code). |
Method | visit |
Return node visitor. |
Method | visit |
Check duplicate value in set. |
Method | visit |
Update try...finally flag. |
Method | visit |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | name |
Name of the provider. |
Class Variable | reports |
Undocumented |
Static Method | _filter |
Undocumented |
Static Method | _has |
Undocumented |
Static Method | _name |
Return whether `test` tests a name certain to hold a generator, or optionally a call that should be then tested to see if *it* returns only generators. |
Method | _check |
Check for dangerous default values as arguments. |
Method | _check |
Undocumented |
Method | _check |
Check that a node is not inside a 'finally' clause of a 'try...finally' statement. |
Method | _check |
Undocumented |
Method | _check |
Check that the argument to `reversed` is a sequence. |
Method | _check |
Undocumented |
Method | _check |
Check unreachable code. |
Method | _check |
Undocumented |
Instance Variable | _py38 |
Undocumented |
Instance Variable | _tryfinallys |
Undocumented |
Inherited from BaseChecker
(via _BasicChecker
):
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 |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | options |
Options provided by this provider. |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via _BasicChecker
, BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
pylint.checkers.BaseChecker.__init__
Checker instances should have the linter as argument.
def visit_assert(self, node:
nodes.Assert
):
(source)
¶
Check whether assert is used on a tuple or string literal.
def visit_assign(self, node:
nodes.Assign
):
(source)
¶
Undocumented
def visit_break(self, node:
nodes.Break
):
(source)
¶
Break node visitor. 1 - check if the node has a right sibling (if so, that's some unreachable code) 2 - check if the node is inside the 'finally' clause of a 'try...finally' block
def visit_call(self, node:
nodes.Call
):
(source)
¶
Visit a Call node.
def visit_comprehension(self, node:
nodes.Comprehension
):
(source)
¶
Undocumented
def visit_continue(self, node:
nodes.Continue
):
(source)
¶
Check is the node has a right sibling (if so, that's some unreachable code).
def visit_dict(self, node:
nodes.Dict
):
(source)
¶
Check duplicate key in dictionary.
def visit_expr(self, node:
nodes.Expr
):
(source)
¶
Check for various kind of statements without effect.
def visit_for(self, node:
nodes.For
):
(source)
¶
Undocumented
def visit_functiondef(self, node:
nodes.FunctionDef
):
(source)
¶
Check function name, docstring, arguments, redefinition, variable names, max locals.
def visit_if(self, node:
nodes.If
):
(source)
¶
Undocumented
def visit_ifexp(self, node:
nodes.IfExp
):
(source)
¶
Undocumented
def visit_lambda(self, node:
nodes.Lambda
):
(source)
¶
Check whether the lambda is suspicious.
def visit_raise(self, node:
nodes.Raise
):
(source)
¶
Check if the node has a right sibling (if so, that's some unreachable code).
def visit_return(self, node:
nodes.Return
):
(source)
¶
Return node visitor. 1 - check if the node has a right sibling (if so, that's some unreachable code) 2 - check if the node is inside the 'finally' clause of a 'try...finally' block
def visit_set(self, node:
nodes.Set
):
(source)
¶
Check duplicate value in set.
def visit_with(self, node:
nodes.With
):
(source)
¶
Undocumented
def _filter_vararg(node:
nodes.Lambda
, call_args: list[ nodes.NodeNG]
) -> Iterator[ nodes.NodeNG]
:
(source)
¶
Undocumented
def _has_variadic_argument(args:
list[ nodes.Starred|nodes.Keyword]
, variadic_name: str
) -> bool
:
(source)
¶
Undocumented
def _name_holds_generator(test:
nodes.Name
) -> tuple[ bool, nodes.Call|None]
:
(source)
¶
Return whether `test` tests a name certain to hold a generator, or optionally a call that should be then tested to see if *it* returns only generators.
nodes.Break|nodes.Return
, node_name: str
, breaker_classes: tuple[ nodes.NodeNG, ...]
= ()):
(source)
¶
Check that a node is not inside a 'finally' clause of a 'try...finally' statement. If we find a parent which type is in breaker_classes before a 'try...finally' block we skip the whole check.
(((nodes.Return|nodes.Continue)|nodes.Break)|nodes.Raise)|nodes.Call
, confidence: Confidence
= HIGH):
(source)
¶
Check unreachable code.
(nodes.If|nodes.IfExp)|nodes.Comprehension
, test: nodes.NodeNG|None
):
(source)
¶
Undocumented