Skip to content

Commit 1bfe27e

Browse files
committed
as per reviews
1 parent 7c4caf2 commit 1bfe27e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/enforce_match_arg_in_assert_produces_warning.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""
2-
32
Enforce that all usages of tm.assert_produces_warning use
43
the "match" argument. This will help ensure that users always see
54
the correct warning message.
@@ -8,6 +7,9 @@
87
and tm.assert_produces_warning(False) are excluded as no warning is
98
produced.
109
10+
This is meant to be run as a pre-commit hook - to run it manually, you can do:
11+
12+
pre-commit run enforce-match-arg-in-assert-produces-warning --all-files
1113
"""
1214

1315

@@ -68,14 +70,14 @@ def main(argv: Sequence[str] | None = None) -> None:
6870
parser.add_argument("paths", nargs="*")
6971

7072
args = parser.parse_args(argv)
71-
isMatchMissing = False
73+
is_match_missing = False
7274

7375
for filename in args.paths:
7476
with open(filename, encoding="utf-8") as fd:
7577
content = fd.read()
76-
isMatchMissing = check_for_match_arg(content, filename) | isMatchMissing
78+
is_match_missing = check_for_match_arg(content, filename) | is_match_missing
7779

78-
if isMatchMissing:
80+
if is_match_missing:
7981
sys.exit(1)
8082

8183

0 commit comments

Comments
 (0)