{"id":6634,"library":"flake8-debugger","title":"flake8-debugger","description":"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.","status":"active","version":"4.1.2","language":"en","source_language":"en","source_url":"https://github.com/jbkahn/flake8-debugger","tags":["flake8","linter","code quality","debugger","static analysis"],"install":[{"cmd":"pip install flake8-debugger","lang":"bash","label":"Install flake8-debugger"}],"dependencies":[{"reason":"This is a plugin for flake8 and requires flake8 to be installed to function. While not an explicit install_requires dependency, it's a functional requirement.","package":"flake8","optional":false}],"imports":[],"quickstart":{"code":"import os\n\ndef my_function():\n    # This line will be flagged by flake8-debugger\n    if os.environ.get('DEBUG_ENABLED', 'false').lower() == 'true':\n        import pdb; pdb.set_trace()\n    print(\"Hello, world!\")\n\nmy_function()\n\n# To run this example:\n# 1. Save the code as example.py\n# 2. Run 'pip install flake8 flake8-debugger'\n# 3. Run 'flake8 example.py' in your terminal\n# Expected output will include an error like 'example.py:6:9: D001 debugger detected'","lang":"python","description":"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."},"warnings":[{"fix":"Ensure your project uses Python 3.7 or newer. Upgrade your Python environment if necessary.","message":"Support for Python 3.6 was dropped in version 4.1.0.","severity":"breaking","affected_versions":">=4.1.0"},{"fix":"Migrate your project to Python 3.x. Version 3.1.0 was the last to explicitly support Python 2.7.","message":"Official support for Python 2.7 was dropped in version 4.0.0.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"No fix needed, this is intended behavior. Just ensure `flake8` is installed and run it as usual.","message":"flake8-debugger works as a plugin and does not require any explicit imports or configuration files to enable. Simply installing it makes it active when you run the `flake8` command.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For critical applications, supplement static analysis with runtime checks or enforce strict code review policies against debugging statements.","message":"While comprehensive, flake8-debugger relies on AST parsing and might not catch highly obfuscated or dynamic debugger calls. It primarily targets common patterns like `pdb.set_trace()` or `breakpoint()`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}