--- id: flake8-black version: "0.4.0" license: MIT license_treatment: permissive maintenance: active --- # flake8-black — flake8 plugin to call black as a code style validator License: permissive · Maintenance: active · Downloads: 668.8K/mo ## What it is and what it does flake8-black bridges black and flake8 by letting you run black's code style checks as a flake8 plugin. Instead of running black and flake8 as separate tools, you invoke flake8 once and get BLK error codes (BLK100 for formatting violations, BLK9xx for internal errors) whenever black would reformat your code. The plugin reads black configuration from pyproject.toml if present, respecting target_version, skip_string_normalization, and line_length settings. It's useful in CI pipelines and pre-commit hooks where you want unified linting output. The plugin depends on flake8, black, and tomli (for TOML parsing). Note that if you're already using pre-commit, you can call black and flake8 directly there instead of using this plugin—it's most valuable when you need black validation integrated into an existing flake8 workflow. Use it for: - Enforce black formatting standards in CI without running black and flake8 as separate commands. - Add black style checks to existing flake8 linting pipelines in git pre-commit hooks. - Catch code that deviates from black's style before it's committed, using BLK100 violations. - Validate that code matches black formatting in projects where black is the canonical formatter. - Detect when black configuration changes would trigger new formatting violations across a codebase. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 plugin that runs black's code style validation within the flake8 linting ecosystem, reporting violations with BLK error codes when black would make formatting changes. Yes, if you use flake8 and want black validation integrated into a single linting pass. Install it when you need unified error reporting or are already committed to flake8 as your linting hub. Skip it if you use pre-commit directly (call black and flake8 separately there instead) or if you run black as a formatter without linting integration. ## Install pip install flake8-black uv add flake8-black poetry add flake8-black ## Installing flake8-black Before you install: Low friction install with three straightforward runtime dependencies (flake8, black, tomli). Active maintenance: last commit 2026-08-03, tested on Python 3.9 through 3.13 and recent black versions including 25.9.0. License in practice: MIT licensed under permissive terms, imposing no restrictions on use or distribution in your own projects. Quickstart: pip install flake8-black Then run flake8 normally; the plugin auto-registers: flake8 example.py Or select only BLK codes: flake8 --select BLK example.py Requires Python 3.9 or later; black itself can format code written for older Python versions. Verify before relying: - Whether the plugin correctly handles all edge cases when black configuration differs from flake8 settings. - Performance impact when running on large codebases with many files. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 668.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flake8 black integration, black code style validator, flake8 formatting plugin, python code style linting, black format checker, code-style, linting-plugin [View on SkillFed](https://skillfed.io/packages/flake8-black) · [View on PyPI](https://pypi.org/project/flake8-black/)