8000 Fix comment formatting · python/cpython@f35ba60 · GitHub
[go: up one dir, main page]

Skip to content

Commit f35ba60

Browse files
committed
Fix comment formatting
1 parent fb91e3e commit f35ba60

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Tools/build/check_warnings.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def extract_warnings_from_compiler_output_json(
4747
but includes many json objects and may include other output
4848
that is not json.
4949
"""
50-
# Regex to find json arrays at the top level of the file in the compiler output
50+
# Regex to find json arrays at the top level of the file
51+
# in the compiler output
5152
json_arrays = re.findall(
5253
r"\[(?:[^[\]]|\[[^\]]*\])*\]", compiler_output
5354
)
@@ -64,7 +65,6 @@ def extract_warnings_from_compiler_output_json(
6465
for warning in warning_list:
6566
locations = warning["locations"]
6667
for location in locations:
67-
found_location = False
6868
for key in ["caret", "start", "end"]:
6969
if key in location:
7070
compiler_warnings.append(
@@ -91,7 +91,8 @@ def extract_warnings_from_compiler_output_json(
9191

9292
def get_warnings_by_file(warnings: list[dict]) -> dict[str, list[dict]]:
9393
"""
94-
Returns a dictionary where the key is the file and the data is the warnings in that file
94+
Returns a dictionary where the key is the file and the data is the warnings
95+
in that file
9596
"""
9697
warnings_by_file = defaultdict(list)
9798
for warning in warnings:
@@ -105,8 +106,9 @@ def get_unexpected_warnings(
105106
files_with_warnings: dict[str, list[dict]],
106107
) -> int:
107108
"""
108-
Returns failure status if warnings discovered in list of warnings are associated with a file
109-
that is not found in the list of files with expected warnings
109+
Returns failure status if warnings discovered in list of warnings
110+
are associated with a file that is not found in the list of files
111+
with expected warnings
110112
"""
111113
unexpected_warnings = []
112114
for file in files_with_warnings.keys():
@@ -127,8 +129,8 @@ def get_unexpected_improvements(
127129
files_with_warnings: dict[str, list[dict]],
128130
) -> int:
129131
"""
130-
Returns failure status if there are no warnings in the list of warnings for a file
131-
that is in the list of files with expected warnings
132+
Returns failure status if there are no warnings in the list of warnings
133+
for a file that is in the list of files with expected warnings
132134
"""
133135
unexpected_improvements = []
134136
for file in files_with_expected_warnings:
@@ -171,7 +173,8 @@ def main(argv: list[str] | None = None) -> int:
171173
"--fail-on-improvement",
172174
action="store_true",
173175
default=False,
174-
help="Flag to fail if files that were expected to have warnings have no warnings",
176+
help="Flag to fail if files that were expected "
177+
"to have warnings have no warnings",
175178
)
176179
parser.add_argument(
177180
"-t",

0 commit comments

Comments
 (0)
0