flake8-eradicate is a Flake8 plugin designed to identify and flag commented-out code within your Python projects. It helps enforce code cleanliness by pointing out code that might be dead, unused, or temporarily disabled. The current version is 1.5.0, and it maintains an active release cadence, typically releasing updates every few months to support newer Python and Flake8 versions.
pip install flake8-eradicateVerified import paths — ran on the pinned version, not inferred.
To use flake8-eradicate, simply install it alongside flake8. The plugin automatically registers itself, and subsequent runs of `flake8` will include checks for commented-out code, reporting them as E7901 errors.
Upgrade your Python environment to version 3.8 or newer. The library's `requires_python` specifies `>=3.8,<4.0`.
Understand that the plugin aims to identify potential dead code. If you have valid, non-code comments that trigger the rule, you might need to adjust your commenting style or use the whitelisting options.
Ensure your `flake8` installation is relatively up-to-date, preferably `4.0.0` or `5.0.0` or newer, to guarantee full compatibility and access to the latest features and fixes.
Utilize `--eradicate-whitelist <pattern>` and `--eradicate-whitelist-append <pattern>` options to specify regular expressions for paths to ignore. This helps in managing false positives or intentional commented code.