flake8-pie

raw JSON →
0.16.0 verified Mon Apr 27 auth: no python

A flake8 plugin with a growing collection of opinionated Python lint rules (PIE). Currently v0.16.0, maintained sporadically. Adds ~40 custom checks targeting code smell, performance, and modern Python idioms.

pip install flake8-pie
error flake8.errors.Flake8Exception: Plugin 'flake8_pie' is not installed.
cause flake8-pie not installed in the same environment as flake8.
fix
pip install flake8 flake8-pie in the same environment.
error AttributeError: module 'flake8_pie' has no attribute 'visitors'
cause Trying to import internal module directly; plugin is not meant to be imported in user code.
fix
Do not import flake8_pie in your code. Use flake8 command line only.
error PIE798: no-unnecessary-class
cause Rule fires on classes that only contain static methods or constants; considered unnecessary.
fix
Replace the class with a module-level constants/functions, or suppress with # noqa: PIE798.
breaking v0.15.0 (or v0.14.0) added 18+ new rules. Upgrading may expose new violations in existing code.
fix Review new rules via flake8 --help or docs; optionally add per‑rule ignores in config.
gotcha Rules are off by default. You must explicitly enable them via --select=PIE or --enable-extensions=PIE.
fix Use flake8 --select=PIE or set select = PIE in .flake8 config.
gotcha Rule codes are not stable between major versions; rename/removal is possible. Pin flake8-pie version in CI.
fix Pin version e.g. flake8-pie==0.16.0 in requirements.
deprecated Some rules (e.g., PIE781, PIE782) have been removed or merged into other rules. Check changelog.
fix Update .flake8 ignore lists and replace removed codes with current equivalents.

Install both flake8 and the plugin, then run flake8 with the --select=PIE flag to see pie‑specific errors.

pip install flake8 flake8-pie
flake8 your_code.py --select=PIE