diff --git a/setup.cfg b/setup.cfg index f00e6f7..66f66ec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -269,6 +269,21 @@ single_line_exclusions = typing [mypy] cache_dir = .cache/mypy +# Check the interior of functions without type annotations. +check_untyped_defs = true + +# Disallow generic types without explicit type parameters. +disallow_any_generics = true + +# Disallow functions with incomplete type annotations. +disallow_incomplete_defs = true + +# Disallow calling functions without type annotations. +disallow_untyped_calls = true + +# Disallow functions without type annotations (or incomplete annotations). +disallow_untyped_defs = true + [mypy-folium.*] ignore_missing_imports = true [mypy-geopy.*] diff --git a/src/urban_meal_delivery/console/decorators.py b/src/urban_meal_delivery/console/decorators.py index ef416dd..74d3714 100644 --- a/src/urban_meal_delivery/console/decorators.py +++ b/src/urban_meal_delivery/console/decorators.py @@ -9,10 +9,12 @@ from typing import Any, Callable import click -def db_revision(rev: str) -> Callable: # pragma: no cover -> easy to check visually +def db_revision( + rev: str, +) -> Callable[..., Callable[..., Any]]: # pragma: no cover -> easy to check visually """A decorator ensuring the database is at a given revision.""" - def decorator(func: Callable) -> Callable: + def decorator(func: Callable[..., Any]) -> Callable[..., Any]: @functools.wraps(func) def ensure(*args: Any, **kwargs: Any) -> Any: # noqa:WPS430 """Do not execute the `func` if the revision does not match."""