Checker¶
Entry point to the app.
Represents a checker business entity. There’s only a single checker instance that runs a lot of visitors.
That’s how all flake8
plugins work:
Checker API¶
- final class Checker(tree, file_tokens, filename='stdin')[source]¶
Bases:
object
Implementation of checker.
- name¶
required by the
flake8
API, should match the package name.
- version¶
required by the
flake8
API, defined in the packaging file.
- config¶
custom configuration object used to provide and parse options:
- :class:`wemake_python_styleguide.options.config.Configuration`.
- options¶
option structure passed by
flake8
:
- :class:`wemake_python_styleguide.options.validation.ValidatedOptions`.
- __init__(tree, file_tokens, filename='stdin')[source]¶
Creates new checker instance.
These parameter names should not be changed.
flake8
has special API that passes concrete parameters to the plugins that ask for them.flake8
also decides how to execute this plugin based on its parameters. This one is executed once per module.- Parameters:
tree (
AST
) –ast
tree parsed byflake8
.file_tokens (
Sequence
[TokenInfo
]) –tokenize.tokenize
parsed file tokens.filename (
str
) – module file name, might be empty if piping is used.
- classmethod add_options(parser)[source]¶
flake8
api method to register new plugin options.See
wemake_python_styleguide.options.config.Configuration
docs for detailed options reference.- Parameters:
parser (
OptionManager
) –flake8
option parser instance.- Return type:
None