python.lang.best-practice.pdb.python-debugger-found

Author
6,393
Download Count*
License
Importing the python debugger; did you mean to leave this in?
Run Locally
Run in CI
Defintion
rules:
- id: python-debugger-found
pattern-either:
- pattern: import pdb
- pattern: pdb.set_trace()
message: Importing the python debugger; did you mean to leave this in?
severity: WARNING
languages:
- python
metadata:
category: best-practice
technology:
- python
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
Examples
pdb.py
# ruleid: python-debugger-found
import pdb
# ruleid: python-debugger-found
pdb.set_trace()
def foo():
# ok: python-debugger-found
p = not_pdb.set_trace()
Short Link: https://sg.run/b7NE