Skip to main content

flake8-toml-config

Configure flake8 via pyproject.toml. Supports local plugins.


This flake8 plugin adds support for loading the flake8 configuration from pyproject.toml files, including loading local plugins.

The plugin will automatically find a pyproject.toml file in the current working directory where flake8 is run from. It also overrides the --config CLI option so that a TOML file can be specified to load the config from:

flake8 --config custom.toml

flake8-toml-config will respect the --isolated flag.

Note that this plugin replaces flake8’s built-in support for other config file formats. While the plugin is installed, config can only be read from TOML files.

Table of contents

Configuration translation

Below is an example of a flake8 configuration as it would appear in a .flake8 file:

[flake8]
max-line-length = 80
extend-select = B950
extend-ignore = E203,E501,E701

[flake8:local-plugins]
paths = ./assets/flake8
extension =
    CL1 = custom_repo_linter:Plugin1
    CL2 = custom_repo_linter:Plugin2
reporter =
    CR = custom_repo_reporter:Plugin

Below is the equivalent configuration, suitable for use in a pyproject.toml file. Note that the flake8:local-plugins section requires quotes in the TOML format:

[tool.flake8]
max-line-length = 80
extend-select = ["B950"]
extend-ignore = ["E203", "E501", "E701"]

[tool."flake8:local-plugins"]
paths = ["./assets/flake8"]
extension.CL1 = "custom_repo_linter:Plugin1"
extension.CL2 = "custom_repo_linter:Plugin2"
reporter.CR = "custom_repo_reporter:Plugin"

Alternatively, multi-line TOML strings can be used for clearer config parity:

# ...
[tool."flake8:local-plugins"]
paths = ["./assets/flake8"]
extension = """
    CL1 = custom_repo_linter:Plugin1
    CL2 = custom_repo_linter:Plugin2
"""
reporter = """
    CR = custom_repo_reporter:Plugin
"""

pipx usage

If flake8 is installed using pipx, you can inject this plugin:

pipx inject flake8 flake8-toml-config

pre-commit usage

Add this plugin as an additional dependency:

- repo: "https://github.com/pycqa/flake8"
  rev: "c48217e1fc006c2dddd14df54e83b67da15de5cd"  # frozen: 7.3.0
  hooks:
    - id: "flake8"
      additional_dependencies:
        - "flake8-toml-config==1.1.0"

Note that the pre-commit autoupdate command, and pre-commit.ci, do not update additional dependencies. Consider using upadup to auto-update additional dependencies as needed.

Metadata

Release files for flake8-toml-config 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-toml-config 1.1.0
File Size Uploaded Provenance Actions
flake8_toml_config-1.1.0.tar.gz 5.0 kB Without provenance Details for flake8_toml_config-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-toml-config 1.1.0
File Interpreter ABI Platform Actions
flake8_toml_config-1.1.0-py3-none-any.whl Python 3 none any Details for flake8_toml_config-1.1.0-py3-none-any.whl

Total release size: 11.1 kB

Release files / flake8_toml_config-1.1.0.tar.gz

Download URL flake8_toml_config-1.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
517cbb88ce451b6eb1301687fc480cf528898fe80a223ededbaf2ba7f4f881b7
BLAKE2b-256 checksum
How to use checksums
c2332b01c1905e60df6d9acc4ac0dbf8887fd800c5d02d2527250505341a6160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / flake8_toml_config-1.1.0-py3-none-any.whl

Download URL flake8_toml_config-1.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
606d0306b0a47bdd0358b69c38b2b35266fee657450fcd03b3e7392b03a4f651
BLAKE2b-256 checksum
How to use checksums
37a31ec14ed8bac06c4fb6c97bb658882c6d525f0abb459dd55f10ac74956fb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for flake8-toml-config 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page