Skip to content

Commit 823f0d9

Browse files
Apply Maciek's suggestion
Co-authored-by: Maciej Olko <[email protected]>
1 parent b927a49 commit 823f0d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sphinx_lint.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
def store_and_count_failures(clones_dir: str, repo: str, language_code: str) -> int:
99
failed_checks = list(chain.from_iterable(yield_failures(clones_dir, repo)))
10-
log = '\n'.join([str(c) for c in failed_checks]).replace(
11-
str(Path(clones_dir, 'rebased_translations', repo)) + '/', ''
12-
)
10+
prefix = f'{Path(clones_dir, 'rebased_translations', repo)}/'
11+
log = '\n'.join(map(lambda check: check.removeprefix(prefix), map(str, failed_checks)))
1312
filepath = Path(f'build/warnings-lint-{language_code}.txt')
1413
filepath.write_text(log)
1514
return len(failed_checks)

0 commit comments

Comments
 (0)