flake8-breakpoint

raw JSON →
1.1.0 verified Fri May 01 auth: no python

A Flake8 plugin that detects forgotten breakpoint() calls (and pdb.set_trace()) in Python code. Version 1.1.0, last updated 2020-04-09, maintenance mode.

pip install flake8-breakpoint
error T100 breakpoint found
cause The default warning code for forgotten breakpoints; users might expect a different code or no output.
fix
Use --extend-ignore=T100 in flake8 config to ignore if intentional.
error ModuleNotFoundError: No module named 'flake8_breakpoint'
cause Import attempted with wrong module name due to hyphen vs underscore.
fix
Install the package and use: from flake8_breakpoint import BreakpointChecker (if using programmatically).
gotcha Flake8 must be installed separately; the plugin alone doesn't run linting.
fix Install flake8 alongside: pip install flake8 flake8-breakpoint
gotcha The plugin only checks for breakpoint() and pdb.set_trace(), not other debuggers like ipdb or pdb.is_resource().
fix For custom debuggers, write a custom flake8 plugin or use a tool like 'debug-detector'.
deprecated Python 3.6 reached end-of-life; requires Python >=3.6 but may not work with Python 3.10+ due to flake8 updates.
fix Pin flake8 to a compatible version (<5.0) if on Python 3.6-3.8.

Install flake8 and the plugin, then run flake8 on a file containing a breakpoint to see the T100 warning.

pip install flake8 flake8-breakpoint
echo 'import pdb; pdb.set_trace()' > test.py
flake8 test.py