Skip to content

Commit

Permalink
add flake8-debugger plugin to detect pdb/set_trace() lines
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 25, 2022
1 parent 54c0648 commit 4f05331
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ DEPS = \
concurrencytest \
coverage \
flake8 \
flake8-blind-except \
flake8-bugbear \
flake8-debugger \
flake8-print \
flake8-blind-except \
isort \
pyperf \
pypinfo \
Expand Down
8 changes: 4 additions & 4 deletions scripts/internal/git_pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def main():
print("%s:%s %r" % (path, lineno, line))
return exit("space at end of line")
line = line.rstrip()
# pdb
if "pdb.set_trace" in line:
print("%s:%s %s" % (path, lineno, line))
return exit("you forgot a pdb in your python code")
# # pdb (now provided by flake8-debugger plugin)
# if "pdb.set_trace" in line:
# print("%s:%s %s" % (path, lineno, line))
# return exit("you forgot a pdb in your python code")
# # bare except clause (now provided by flake8-blind-except plugin)
# if "except:" in line and not line.endswith("# NOQA"):
# print("%s:%s %s" % (path, lineno, line))
Expand Down
6 changes: 5 additions & 1 deletion scripts/internal/winmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@
DEPS = [
"coverage",
"flake8",
"flake8-blind-except",
"flake8-bugbear",
"flake8-debugger",
"flake8-print",
"nose",
"pdbpp",
"pip",
"pyperf",
"pyreadline",
"requests"
"setuptools",
"wheel",
"requests"
]
if sys.version_info[:2] <= (2, 7):
DEPS.append('mock')
Expand Down

0 comments on commit 4f05331

Please sign in to comment.