flake8-eradicate
Flake8 plugin to find commented out code
What it is and what it does
flake8-eradicate is a linting plugin that integrates with flake8 to automatically find and flag commented-out code in Python files. It wraps the eradicate library and reports violations using the E800 error code, making dead code visible during normal linting workflows. The plugin supports configuration options to enable aggressive detection mode and customize whitelists for exceptions.
The package is designed for teams that want to enforce code cleanliness standards by preventing commented code from accumulating in repositories. It runs as part of your existing flake8 checks, requiring no separate tooling or workflow changes. Dependencies are minimal: flake8 itself, eradicate for the detection logic, and attrs for internal data structures.
Use it for:
- Enforce code review standards by catching commented-out code before merge in CI/CD pipelines.
- Maintain long-term code quality by preventing dead code accumulation in active projects.
- Integrate into wemake-python-styleguide or similar comprehensive linting configurations.
- Customize detection rules per project using whitelist options to avoid false positives on intentional comments.
- Audit existing codebases to identify and remove commented code during refactoring efforts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A flake8 plugin that detects commented-out code in Python files and reports it as a linting error, helping maintain code cleanliness by flagging dead code that should be removed.
Yes, if you use flake8 and want to enforce removal of commented-out code. The plugin is stable, has no security vulnerabilities, and integrates seamlessly into existing workflows. The aging maintenance status (last release May 2023) is not a blocker for a mature, focused tool, but monitor the repository if you need active feature development or rapid bug fixes.
Install
flake8-eradicate on PyPI
pip
pip install flake8-eradicateuv
uv add flake8-eradicatepoetry
poetry add flake8-eradicateInstalling flake8-eradicate
Before you install
Low friction install with three straightforward runtime dependencies (flake8, eradicate, attrs). Maintenance status is aging—last release was 2023-05-31 and no commits since 2025-03-14—but the package is stable and production-ready with no known vulnerabilities.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions. No licensing concerns for most projects.
Quickstart
pip install flake8-eradicate
flake8 your_module.py
# Raises E800 error for commented-out code found
Requires flake8 to be installed and Python 3.8 or later.
Verify before relying
- Whether aggressive mode (--eradicate-aggressive) false-positive rate is acceptable for your codebase.
- Performance impact when scanning large codebases with many files.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — flake8, eradicate, attrs |
| Maintenance | aging — 1,171 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 764,350/month — #5,124 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_eradicate-1.5.0-py3-none-any.whl
Keywords: flake8, plugin, linting, wemake.services, code quality
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
eradicateEradicate detects and removes commented-out…
permissive · top 5,000 on PyPI
dlintDlint is a flake8 plugin that adds…
permissive · top 15,000 on PyPI
vultureVulture is a static code analyzer that finds…
permissive · top 5,000 on PyPI
flake8-broken-lineA flake8 plugin that detects and forbids…
permissive · top 15,000 on PyPI
wemake-python-styleguideA flake8 plugin that enforces strict,…
permissive · top 15,000 on PyPI
uncalledDetects unused functions in Python projects…
permissive · top 15,000 on PyPI
flake8Flake8 is a command-line tool that combines…
permissive · top 1,000 on PyPI
flake8-asyncA flake8 plugin that detects async-related…
permissive · top 15,000 on PyPI
flake8-printA flake8 plugin that detects print statements…
permissive · top 5,000 on PyPI
flake8-pyiA Flake8 plugin that lints Python type stub…
permissive · top 5,000 on PyPI