flake8-debugger is a plugin for the flake8 code quality tool that checks for the presence of common debugger statements (like `pdb.set_trace()`, `ipdb.set_trace()`, and `breakpoint()`) in Python code. This helps prevent accidental commits of debugging code into production. The current version is 4.1.2. Releases are made periodically, typically following updates to Python versions or the flake8 ecosystem.
pip install flake8-debuggerNo compatibility data collected yet for this library.
Install flake8-debugger alongside flake8. It automatically integrates. Create a Python file with a debugger statement and run flake8 on it to see the plugin in action.
Ensure your project uses Python 3.7 or newer. Upgrade your Python environment if necessary.
Migrate your project to Python 3.x. Version 3.1.0 was the last to explicitly support Python 2.7.
No fix needed, this is intended behavior. Just ensure `flake8` is installed and run it as usual.
For critical applications, supplement static analysis with runtime checks or enforce strict code review policies against debugging statements.
Ensure flake8-debugger is installed and up-to-date in your Python environment (`pip install --upgrade flake8-debugger`). Verify that flake8 recognizes the plugin by running `flake8 --version` and checking for 'flake8-debugger' in the output. Also, ensure the Python version running flake8 is compatible with the installed flake8-debugger version (e.g., Python 3.7+ for recent versions).
Ensure that flake8 is installed and run with the same Python version that your code is written for. It is recommended to use a virtual environment, activate it, and install flake8 and flake8-debugger within that environment.
To ignore F999: For a single line, add `# noqa: F999` at the end of the line. For an entire file, add `# flake8: noqa` at the top of the file, or use the `--per-file-ignores` option in your configuration (e.g., `per-file-ignores = path/to/file.py:F999`). To ignore globally, add `ignore = F999` to the `[flake8]` section in your `setup.cfg`, `tox.ini`, or `.flake8` configuration file, or use `flake8 --ignore F999` on the command line.
First, confirm `flake8-debugger` is installed and recognized (`pip install --upgrade flake8-debugger` then `flake8 --version`). Ensure your flake8 configuration (e.g., `setup.cfg`, `pyproject.toml`, `.flake8`) does not accidentally exclude the F999 code or the files where you expect the checks to run. Review the `exclude` and `ignore` settings in your flake8 configuration.