8000 Use path prefix for clang parsing · python/cpython@8eb8a51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8eb8a51

Browse files
committed
Use path prefix for clang parsing
1 parent caf6b1a commit 8eb8a51

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Tools/build/.warningignore_macos

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Objects/mimalloc/page.c 1
5454
Objects/mimalloc/random.c 1
5555
Objects/mimalloc/segment.c 11
5656
Objects/mimalloc/stats.c 1
57-
Objects/mimalloc/prim/osx/.unix/prim.c 2
57+
Objects/mimalloc/prim/osx/../unix/prim.c 2
5858
Objects/obmalloc.c 6
5959
Objects/rangeobject.c 10
6060
Objects/setobject.c 13
@@ -227,4 +227,4 @@ Modules/clinic/_testclinic.c.h 1
227227
Modules/_testclinic.c 14
228228
Modules/_testexternalinspection.c 7
229229
Modules/_ctypes/_ctypes_test_generated.c.h 100
230-
Modules/_ctypes/_ctypes_test.c 1
230+
Modules/_ctypes/_ctypes_test.c 1

Tools/build/check_warnings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class FileWarnings(NamedTuple):
1818

1919
def extract_warnings_from_compiler_output_clang(
2020
compiler_output: str,
21+
path_prefix: str | None = None,
2122
) -> list[dict]:
2223
"""
2324
Extracts warnings from the compiler output when using clang
@@ -31,7 +32,7 @@ def extract_warnings_from_compiler_output_clang(
3132
if match := clang_warning_regex.match(line):
3233
compiler_warnings.append(
3334
{
34-
"file": match.group("file"),
35+
"file": match.group("file").lstrip(path_prefix),
3536
"line": match.group("line"),
3637
"column": match.group("column"),
3738
"message": match.group("message"),
@@ -263,6 +264,7 @@ def main(argv: list[str] | None = None) -> int:
263264
elif args.compiler_output_type == "clang":
264265
warnings = extract_warnings_from_compiler_output_clang(
265266
compiler_output_file_contents,
267+
args.path_prefix
266268
)
267269

268270
files_with_warnings = get_warnings_by_file(warnings)

0 commit comments

Comments
 (0)
0