feat: add strict mypy type-checking for app/utils/ module

- Add [[tool.mypy.overrides]] section for app/utils/** with disallow_untyped_defs=true
- Add type annotations to all functions in app/utils/ (12 files)
- Fix type annotations in app/config.py and app/database.py (imported by utils)
- All 85 source files now pass mypy type checking

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-14 00:27:52 +00:00
parent db45c09696
commit 53a9efa56d
12 changed files with 44 additions and 26 deletions
+10 -3
View File
@@ -16,9 +16,9 @@ class TaskLogCollector(logging.Handler):
This captures all logger.info/error/warning output automatically.
"""
def __init__(self):
def __init__(self) -> None:
super().__init__()
self._buffers = defaultdict(list)
self._buffers: defaultdict[str, list[str]] = defaultdict(list)
self._lock = threading.Lock()
def emit(self, record: logging.LogRecord) -> None:
@@ -60,7 +60,14 @@ def _ensure_collector_installed() -> None:
_collector_installed = True
def log_task_progress(task_id, step_name, status, message=None, file_id=None, detail=None):
def log_task_progress(
task_id: str,
step_name: str,
status: str,
message: str | None = None,
file_id: int | None = None,
detail: str | None = None,
) -> None:
"""
Logs the progress of a Celery task to the database.