Skip to content

Commit e6f282f

Browse files
committed
style(verify): strict mypy + ruff compliance for TechEngine
1 parent 22c8d34 commit e6f282f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/verify/http_check.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from collections.abc import Callable, Iterable
1616
from concurrent.futures import ThreadPoolExecutor
1717
from datetime import UTC, datetime
18+
from pathlib import Path
1819
from typing import Any, NamedTuple
1920
from urllib.parse import urlparse
2021
from urllib.request import Request, build_opener
@@ -182,7 +183,7 @@ def _task(url: str) -> CheckResult:
182183
# --- cache -----------------------------------------------------------------------
183184

184185

185-
def load_cache(path=URL_CACHE_PATH) -> dict[str, dict[str, Any]]:
186+
def load_cache(path: Path = URL_CACHE_PATH) -> dict[str, dict[str, Any]]:
186187
return {e["url"]: e for e in ledger.iter_entries(path) if isinstance(e.get("url"), str)}
187188

188189

@@ -200,7 +201,7 @@ def is_fresh(entry: dict[str, Any], now: datetime, ttl_days: int) -> bool:
200201
return (now - ts).days < ttl_days
201202

202203

203-
def save_cache(cache: dict[str, dict[str, Any]], path=URL_CACHE_PATH) -> None:
204+
def save_cache(cache: dict[str, dict[str, Any]], path: Path = URL_CACHE_PATH) -> None:
204205
ledger.replace_all(list(cache.values()), path)
205206

206207

0 commit comments

Comments
 (0)