Make mypy as strict as practical #13

Merged
alexander merged 32 commits from stricter-mypy into develop 2026-12-01 14:26:52 +01:00
Showing only changes of commit d9364eea9e - Show all commits

Set all "strict" options explicitly

Alexander Hess 2026-12-01 09:29:08 +01:00
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -447,6 +447,9 @@ disallow_any_generics = true
# Disallow functions with incomplete type annotations
disallow_incomplete_defs = true
# Allow subclassing `Any` as long as the ORM models' `Base` is untyped
disallow_subclassing_any = false
# Disallow calling functions without type annotations ...
disallow_untyped_calls = true
# ... except for libraries without type annotations
@ -454,12 +457,33 @@ untyped_calls_exclude = [
"folium",
]
# Disallow decorators without type annotations
disallow_untyped_decorators = true
# Disallow functions without type annotations (or incomplete annotations)
disallow_untyped_defs = true
# Require an error code in all "# type: ignore" comments
enable_error_code = ["ignore-without-code"]
# Check further edge cases that are rarely an issue in practice
extra_checks = true
# Treat imported names as re-exported as long as some packages lack `__all__`
no_implicit_reexport = false
# Disallow comparisons of non-overlapping types (e.g., `str` and `int`)
strict_equality = true
# Report `t.cast()` calls that are not needed
warn_redundant_casts = true
# Allow returning `Any` as long as the ORM models' relationships are untyped
warn_return_any = false
# Report "[[tool.mypy.overrides]]" sections that match no module
warn_unused_configs = true
# Report "# type: ignore" comments that are not needed anymore
warn_unused_ignores = true