Skip to content

Commit 06e31ec

Browse files
Fix (and improve) sphinx-lint log (#114)
Correct warning file path as so that the updated files are committed. Improve logs by removing unrelated file paths, decreasing line length. Co-authored-by: Maciej Olko <[email protected]>
1 parent cd9015a commit 06e31ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sphinx_lint.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
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-
filepath = Path(f'warnings-lint-{language_code}.txt')
11-
filepath.write_text('\n'.join([str(c) for c in failed_checks]))
10+
prefix = f'{Path(clones_dir, "rebased_translations", repo)}/'
11+
log = '\n'.join(
12+
map(lambda check: check.removeprefix(prefix), map(str, failed_checks))
13+
)
14+
filepath = Path(f'build/warnings-lint-{language_code}.txt')
15+
filepath.write_text(log)
1216
return len(failed_checks)
1317

1418

0 commit comments

Comments
 (0)