From b927a491671dd07a6c8b1b7777a5b8160810539b Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Fri, 8 Aug 2025 20:43:33 +0200 Subject: [PATCH 1/3] Commit --- sphinx_lint.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sphinx_lint.py b/sphinx_lint.py index 167cec1b4..563fae992 100644 --- a/sphinx_lint.py +++ b/sphinx_lint.py @@ -7,8 +7,11 @@ def store_and_count_failures(clones_dir: str, repo: str, language_code: str) -> int: failed_checks = list(chain.from_iterable(yield_failures(clones_dir, repo))) - filepath = Path(f'warnings-lint-{language_code}.txt') - filepath.write_text('\n'.join([str(c) for c in failed_checks])) + log = '\n'.join([str(c) for c in failed_checks]).replace( + str(Path(clones_dir, 'rebased_translations', repo)) + '/', '' + ) + filepath = Path(f'build/warnings-lint-{language_code}.txt') + filepath.write_text(log) return len(failed_checks) From 823f0d98cfd0c8685d099c32cce2870549a334b9 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Sat, 9 Aug 2025 07:47:47 +0200 Subject: [PATCH 2/3] Apply Maciek's suggestion Co-authored-by: Maciej Olko --- sphinx_lint.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sphinx_lint.py b/sphinx_lint.py index 563fae992..459173403 100644 --- a/sphinx_lint.py +++ b/sphinx_lint.py @@ -7,9 +7,8 @@ def store_and_count_failures(clones_dir: str, repo: str, language_code: str) -> int: failed_checks = list(chain.from_iterable(yield_failures(clones_dir, repo))) - log = '\n'.join([str(c) for c in failed_checks]).replace( - str(Path(clones_dir, 'rebased_translations', repo)) + '/', '' - ) + prefix = f'{Path(clones_dir, 'rebased_translations', repo)}/' + log = '\n'.join(map(lambda check: check.removeprefix(prefix), map(str, failed_checks))) filepath = Path(f'build/warnings-lint-{language_code}.txt') filepath.write_text(log) return len(failed_checks) From c6ae209224fd03803073691e01dee79b898e1eb2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 05:47:57 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- sphinx_lint.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sphinx_lint.py b/sphinx_lint.py index 459173403..76d1bc242 100644 --- a/sphinx_lint.py +++ b/sphinx_lint.py @@ -7,8 +7,10 @@ def store_and_count_failures(clones_dir: str, repo: str, language_code: str) -> int: failed_checks = list(chain.from_iterable(yield_failures(clones_dir, repo))) - prefix = f'{Path(clones_dir, 'rebased_translations', repo)}/' - log = '\n'.join(map(lambda check: check.removeprefix(prefix), map(str, failed_checks))) + prefix = f'{Path(clones_dir, "rebased_translations", repo)}/' + log = '\n'.join( + map(lambda check: check.removeprefix(prefix), map(str, failed_checks)) + ) filepath = Path(f'build/warnings-lint-{language_code}.txt') filepath.write_text(log) return len(failed_checks)