diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2022-05-25 15:34:10 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2022-05-25 15:34:10 +0200 |
commit | 4f053312934cdca739c3fefe4ada8a4f2d096bdd (patch) | |
tree | 2d6d7640fd5882bb1497b9793475dafcb70bac37 /scripts | |
parent | 54c0648bd1d7552d27c577d65f70c25023001071 (diff) | |
download | psutil-4f053312934cdca739c3fefe4ada8a4f2d096bdd.tar.gz |
add flake8-debugger plugin to detect pdb/set_trace() lines
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/internal/git_pre_commit.py | 8 | ||||
-rwxr-xr-x | scripts/internal/winmake.py | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/scripts/internal/git_pre_commit.py b/scripts/internal/git_pre_commit.py index c86c9f93..46b3bc53 100755 --- a/scripts/internal/git_pre_commit.py +++ b/scripts/internal/git_pre_commit.py @@ -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)) diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index 101a64ef..6dd1a9b7 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -41,14 +41,18 @@ PYPY = '__pypy__' in sys.builtin_module_names 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') |