flake8_helper
¶
A helper library for Flake8 plugins.
Data:
Invariant |
|
Invariant |
Classes:
-
_V
= TypeVar(_V, bound=Visitor)¶ Type:
TypeVar
Invariant
TypeVar
bound toflake8_helper.Visitor
.
-
class
Visitor
[source]¶ Bases:
NodeVisitor
AST node visitor.
Attributes:
The list of Flake8 errors identified by the visitor.
Methods:
report_error
(node, error)Report an error for the given node.
-
_P
= TypeVar(_P, bound=Plugin)¶ Type:
TypeVar
Invariant
TypeVar
bound toflake8_helper.Plugin
.
-
class
Plugin
(tree)[source]¶ -
Abstract base class for Flake8 plugins.
- Parameters
tree (
AST
) – The abstract syntax tree (AST) to check.
Minimum example:
Attributes:
The plugin name.
The plugin version.
The visitor class to use to traverse the AST.
Methods:
run
()Traverse the Abstract Syntax Tree and identify errors.
-
abstract property
visitor_class
¶ The visitor class to use to traverse the AST.