From a886290e6818248a747237cb79ee2eeeb028c1d3 Mon Sep 17 00:00:00 2001 From: Torben <59419684+entorb@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:03:25 +0200 Subject: [PATCH] Update .pre-commit-config.yaml and minor adjustments --- .pre-commit-config.yaml | 4 ++-- scripts/check_chapters.py | 2 +- scripts/check_chapters_test.py | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a986d21a6..34623ee02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,7 +62,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.4.1" + rev: "v0.6.1" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -84,7 +84,7 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.39.0 + rev: v0.41.0 hooks: - id: markdownlint args: ["--disable", "MD013"] diff --git a/scripts/check_chapters.py b/scripts/check_chapters.py index b9dc9fb29..bcd493613 100755 --- a/scripts/check_chapters.py +++ b/scripts/check_chapters.py @@ -52,7 +52,7 @@ def get_list_of_chapter_files() -> list[Path]: """ list_of_files: list[Path] = [] with Path("hpmor.tex").open(encoding="utf-8") as fh: - for line in fh.readlines(): + for line in fh: my_match = re.search(r"^.*include\{(chapters/.+?)\}.*$", line) if my_match: include_path = my_match.group(1) diff --git a/scripts/check_chapters_test.py b/scripts/check_chapters_test.py index cc49d6c1e..5099a0cc7 100644 --- a/scripts/check_chapters_test.py +++ b/scripts/check_chapters_test.py @@ -212,9 +212,7 @@ def test_fix_spell(lang: str) -> None: def checkit(fct: Callable, pairs: list[tuple[str, str]]) -> None: for text, expected_output in pairs: # test of isolated function - assert ( - fct(text) == expected_output # - ), f"'{fct(text)}' != '{expected_output}'" + assert fct(text) == expected_output, f"'{fct(text)}' != '{expected_output}'" # test in complete fix_line context assert (