skillfed

flake8-eradicate

Flake8 plugin to find commented out code

flake8-eradicate v1.5.0 764.4K downloads/30d#5,124 on PyPI315
Permissive license MIT AGING released

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-eradicate

uv

uv add flake8-eradicate

poetry

poetry add flake8-eradicate

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

flake8 commented code detectiondead code linter pluginfind commented out codecode quality lintingremove dead code automationpython code cleanupflake8 extension
code-qualitylinting-pluginflake8-extension

More Python Modules packages