forked from pylint-dev/pylint
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
forgotten-debug-statement
checker (pylint-dev#4771)
* Add ``no-breakpoint`` checker this adds a checker for calls to ``breakpoint()``, ``pdb.set_trace()``, or ``sys.breakpointhook()``. Closes pylint-dev#3692 Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
- Loading branch information
1 parent
a051aa8
commit 5e5f48d
Showing
6 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# pylint: disable=missing-docstring | ||
|
||
import pdb | ||
import sys | ||
|
||
breakpoint() # [forgotten-debug-statement] | ||
sys.breakpointhook() # [forgotten-debug-statement] | ||
pdb.set_trace() # [forgotten-debug-statement] | ||
b = breakpoint | ||
b() # [forgotten-debug-statement] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[testoptions] | ||
min_pyver=3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
forgotten-debug-statement:6:0::"Leaving functions creating breakpoints in production code is not recommended" | ||
forgotten-debug-statement:7:0::"Leaving functions creating breakpoints in production code is not recommended" | ||
forgotten-debug-statement:8:0::"Leaving functions creating breakpoints in production code is not recommended" | ||
forgotten-debug-statement:10:0::"Leaving functions creating breakpoints in production code is not recommended" |