diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abcc194e..b46f149c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,19 +28,19 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.9 + rev: v0.14.3 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.1 + rev: v1.18.2 hooks: - id: mypy args: ["--config-file", "pyproject.toml", "--ignore-missing-imports"] #args: [--strict, --ignore-missing-imports] - repo: https://github.com/sourcery-ai/sourcery - rev: v1.37.0 + rev: v1.40.1b3 hooks: - id: sourcery # The best way to use Sourcery in a pre-commit hook: diff --git a/pythonbible/formatter.py b/pythonbible/formatter.py index fdc471f6..a0696ce6 100644 --- a/pythonbible/formatter.py +++ b/pythonbible/formatter.py @@ -355,7 +355,7 @@ def format_scripture_text(verse_ids: list[int], **kwargs: Any) -> str: current_end_verse: int | None = None for verse_id in verse_ids: - book, chapter_number, verse_number = get_book_chapter_verse(verse_id) + book, chapter_number, _ = get_book_chapter_verse(verse_id) if ( one_verse_per_paragraph diff --git a/tests/converter_test.py b/tests/converter_test.py index f2c84027..b666c954 100644 --- a/tests/converter_test.py +++ b/tests/converter_test.py @@ -105,7 +105,7 @@ def test_convert_verse_ids_to_references_invalid(invalid_verse_id: int) -> None: # Given a list of verse ids with an invalid verse id # When we attempt to convert them into a list of references # Then an error is raised - with pytest.raises(bible.InvalidVerseError, match="1100100 is not a valid verse."): + with pytest.raises(bible.InvalidVerseError, match=r"1100100 is not a valid verse."): bible.convert_verse_ids_to_references([invalid_verse_id]) @@ -116,7 +116,7 @@ def test_convert_verse_ids_to_references_invalid2( # Given a list of verse ids with an invalid verse id # When we attempt to convert them into a list of references # Then an error is raised - with pytest.raises(bible.InvalidVerseError, match="1100100 is not a valid verse."): + with pytest.raises(bible.InvalidVerseError, match=r"1100100 is not a valid verse."): bible.convert_verse_ids_to_references([verse_id, invalid_verse_id]) diff --git a/tests/verses_test.py b/tests/verses_test.py index 1c64bc19..ac5fbab4 100644 --- a/tests/verses_test.py +++ b/tests/verses_test.py @@ -42,7 +42,7 @@ def test_get_verse_id_invalid_verse( # When the get_verse_id() function is called, Then an exception is raised. with pytest.raises( bible.InvalidVerseError, - match="Genesis 1:100 is not a valid Bible verse. Valid verses for that book " + match=r"Genesis 1:100 is not a valid Bible verse. Valid verses for that book " "and chapter are 1-31", ): bible.verses.get_verse_id(book, chapter, invalid_verse) @@ -91,7 +91,7 @@ def test_get_book_chapter_verse_invalid(invalid_verse_id: int) -> None: # Given an invalid verse id # When attempting to get the book, chapter, and verse # Then an error is raised. - with pytest.raises(bible.InvalidVerseError, match="1100100 is not a valid verse."): + with pytest.raises(bible.InvalidVerseError, match=r"1100100 is not a valid verse."): bible.get_book_chapter_verse(invalid_verse_id)