flake8-helper¶
A helper library for Flake8 plugins.
Installation¶
python3 -m pip install flake8-helper --user
First add the required channels
conda config --add channels https://conda.anaconda.org/conda-forge
conda config --add channels https://conda.anaconda.org/domdfcoding
Then install
conda install flake8-helper
python3 -m pip install git+https://github.com/python-formate/flake8-helper@master --user
Contents¶
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.
Downloading source code¶
The flake8-helper
source code is available on GitHub,
and can be accessed from the following URL: https://github.com/python-formate/flake8-helper
If you have git
installed, you can clone the repository with the following command:
git clone https://github.com/python-formate/flake8-helper
Cloning into 'flake8-helper'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126
Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done.
Resolving deltas: 100% (66/66), done.

Downloading a ‘zip’ file of the source code¶
Building from source¶
The recommended way to build flake8-helper
is to use tox:
tox -e build
The source and wheel distributions will be in the directory dist
.
If you wish, you may also use pep517.build or another PEP 517-compatible build tool.
License¶
flake8-helper
is licensed under the MIT License
A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.
Permissions | Conditions | Limitations |
---|---|---|
|
|
Copyright (c) 2021 Dominic Davis-Foster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
View the Function Index or browse the Source Code.