Skip to content

Commit 4c069bc

Browse files
authored
refactor: harden mypy rules (jxmorris12#183)
1 parent 842a9e4 commit 4c069bc

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ ignore = [
149149

150150
[tool.mypy]
151151
files = ["language_tool_python", "tests"]
152+
disallow_any_decorated = true
153+
disallow_any_explicit = true
152154
disallow_any_expr = true
153155
disallow_any_generics = true
154156
disallow_any_unimported = true
@@ -162,6 +164,7 @@ no_implicit_reexport = true
162164
pretty = true
163165
show_error_codes = true
164166
strict_equality = true
167+
strict_equality_for_none = true
165168
warn_redundant_casts = true
166169
warn_return_any = true
167170
warn_unreachable = true

tests/test_download.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def test_install_oldest_supported_version() -> None:
572572
"en-US",
573573
language_tool_download_version="4.0",
574574
) as tool:
575-
assert tool is not None
575+
assert tool.language_tool_download_version == "4.0"
576576
except LanguageToolError:
577577
pytest.fail("Failed to download or initialize the oldest supported version.")
578578

@@ -592,7 +592,9 @@ def test_install_snapshot_version() -> None:
592592
(datetime.now(timezone.utc) - timedelta(days=3)).strftime("%Y%m%d")
593593
),
594594
) as tool:
595-
assert tool is not None
595+
assert tool.language_tool_download_version == (
596+
datetime.now(timezone.utc) - timedelta(days=3)
597+
).strftime("%Y%m%d")
596598
except LanguageToolError:
597599
pytest.skip(
598600
(

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)