We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e513a2 commit ff4eb61Copy full SHA for ff4eb61
1 file changed
pre_commit_hooks/debug_statement_hook.py
@@ -74,8 +74,24 @@ def check_file(filename: str) -> int:
74
def main(argv: Sequence[str] | None = None) -> int:
75
parser = argparse.ArgumentParser()
76
parser.add_argument('filenames', nargs='*', help='Filenames to run')
77
+ parser.add_argument(
78
+ '--forbid',
79
+ type=str, action='append',
80
+ help='Extra module name(s) to forbid'
81
+ )
82
83
+ '--allow',
84
+ type=str,
85
+ action='append',
86
+ help='Extra module name(s) to allow'
87
88
args = parser.parse_args(argv)
89
90
+ for name in args.forbid or ():
91
+ DEBUG_STATEMENTS.add(name)
92
+ for name in args.allow or ():
93
+ DEBUG_STATEMENTS.discard(name)
94
+
95
retv = 0
96
for filename in args.filenames:
97
retv |= check_file(filename)
0 commit comments