Skip to content

Commit eac098b

Browse files
Improve build-warnings.py log (#118)
Strips unnecessary (absolute) path information, shortening lines significantly.
1 parent 568fb04 commit eac098b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build_warnings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@ def number(clones_dir: str, repo: str, language_code: str) -> int:
3333
f'./sphinxbuild/{language_code}', # outputdir
3434
)
3535
)
36+
prefix = f'{Path(clones_dir).resolve()}/cpython/Doc/'
37+
log = '\n'.join(
38+
line.removeprefix(prefix)
39+
for line in Path(warning_file).read_text().splitlines()
40+
)
41+
Path(warning_file).write_text(log)
3642
copyfile(warning_file, f'build/warnings-{language_code}.txt')
3743
return len(findall('ERROR|WARNING', Path(warning_file).read_text()))

0 commit comments

Comments
 (0)