More and more, I am using Python tools like Poetry and Black that use
pyproject.toml as a central configuration file for packaging and tools. The finalized PEP 518 defined the specification for
pyproject.toml, and many tools have adopted it.
Here is my current configuration in
[tool.flakehell] exclude = ["README.rst", "README.md"] format = "colored" max_line_length = 88 show_source = true whitelist = "../../allowlist.txt" [tool.flakehell.plugins] flake8-bandit = ["+*", "-S322"] flake8-bugbear = ["+*"] flake8-builtins = ["+*"] flake8-comprehensions = ["+*"] flake8-darglint = ["+*"] flake8-docstrings = ["+*"] flake8-eradicate = ["+*"] flake8-isort = ["+*"] flake8-mutable = ["+*"] flake8-pytest-style = ["+*"] flake8-spellcheck = ["+*"] mccabe = ["+*"] pep8-naming = ["+*"] pycodestyle = ["+*"] pyflakes = ["+*"] pylint = ["+*"]
The above demonstrates that configuration can be passed from FlakeHell to the relevant plugin, such as the
whitelist variable, a part of flake8-spellcheck.
Also note that certain codes (such as Bandit's S322 warning about
input() that is not relevant in Python 3) can be ignored by prefixing them with a
- and adding them to the list.
Thankfully, there is
flake8helled, a command that replaces
flake8, making it easy to configure your editor to use FlakeHell in place of Flake8.
When using FlakeHell, I frequently use the following commands:
flakehell lintruns the linter, similar to the
flakehell pluginslists all the plugins used, and their configuration status
flakehell missedshows any plugins that are in the configuration but not installed properly (such as with
poetry add -D)
flakehell code S322(or any other code) shows the explanation for that specific warning code.
See FlakeHell's documentation for more direction and ideas.