Awesome Flake8 Extensions
A curated list of awesome flake8 extensions.
Inspired after reading a post.
Contents
All-in-one
Extensions with more than 20 rules inside.
Bugs
Extensions for finding possible bugs.
Clean code
Extensions for finding stylistic issues and enforcing consistent codestyle.
Limitations
Extensions banning specific Python features.
Naming
Extensions for checking names of variables, functions, etc.
Complexity
Extensions for ensuring low code complexity.
Extensions for checking comments.
-
flake8-ado - Check that all Azure DevOps IDs mentioned in the comments are in the correct format and have the corresponding ADO item.
-
flake8-author - Checks Python modules for
__author__
attributes.
-
flake8-coding - Adds coding magic comment checks (coding:) to flake8.
-
flake8-comments - Reports redundant comments.
-
flake8-copyright - Adds copyright checks to flake8.
-
flake8-eradicate - Plugin to find commented out or dead code.
-
flake8-executable - Plugin for checking executable permissions and shebangs.
-
flake8-fixme - Check for FIXME, TODO and other temporary developer notes.
-
flake8-jira-todo-checker - Check that every TODO comment has a valid JIRA issue ID next to it.
-
flake8-noqa - Validate
# noqa
comments.
-
flake8-ownership - Checker for assuring that author, copyright, and license are specified in source files.
-
flake8-todo - Check for TODO notes.
-
flake8-todos - Lint TODO comments to be consistent and have an issue linked.
Docstrings
Extensions for checking docstrings.
Tools empowering flake8.
-
flake8-codes - CLI tool to introspect flake8 plugins and their codes.
-
flake8-pyproject - Flake8 plug-in loading the configuration from pyproject.toml.
-
flake8-pyprojecttoml - Adds support for reading flake8 config from pyproject.toml.
-
flake8-ruler - More powerful configs for flake8.
-
flakehell - Wrapper to make it nice, legacy-friendly, and configurable.
-
flakes - Web list of flake8 plugins and their codes, a wrapper around flake8-codes.
-
nitpick - Enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects.
-
wps-playground - Online playground for wemake-python-styleguide.
-
yesqa - A tool to automatically remove unnecessary
# noqa
comments.
-
flake8-in-file-ignores - Allow in file ignore e.g.
# flake8-in-file-ignores: noqa: E731
.
Imports
Extensions for checking import statements.
Testing
Extensions for testing.
-
flake8-aaa - Lints tests against the Arrange Act Assert pattern.
-
flake8-assertive - Unittest assert method checker.
-
flake8-mock - Provides checking mock non-existent methods.
-
flake8-mock-spec - Enforce the use of the spec argument on mocks ensuring that your use of mocks is compliant with the interface of the object being mocked.
-
flake8-pytest-style - Checks for common style issues or inconsistencies with pytest-based tests.
-
flake8-pytest - Enforces to use
pytest
-style assertions.
-
flake8-pytestrail - Checks TestRail test case IDs.
Type annotations
Extensions for type annotations.
Library-specific checks
Extensions for linting usage of specific libraries.
-
flake8-django-migrations - Plugin to lint for backwards incompatible database migrations in Django.
-
flake8-django - Plugin for Django projects.
-
flake8-fastapi - Checks FastAPI code against opinionated style rules.
-
flake8-numba - Plugin that facilitates code development with
numba
package.
-
flake8-scrapy - Plugin to catch common issues on Scrapy spiders.
-
pandas-vet - Plugin that provides opinionated linting for pandas code.
-
TorchFix - Plugin for code that uses PyTorch.
Integrations
Extensions for running flake8 not only on Python files.
-
flake8-markdown - Lints Python code blocks in Markdown files using flake8.
-
flake8-nb - Runs flake8 on
*.ipynb
(jupyter notebook) files.
-
flake8-pyi - Plugin for Flake8 that provides specializations for type hinting stub files.
-
flake8-rst - Checks on code in
*.rst
files or in docstrings.
-
jupyterlab-flake8 - Jupyterlab python linter for notebooks and text files using flake8.
Wrappers
Wrappers around other tools making it possible to use them with flake8.
Extensions for formatting flake8 output.