chore: resolve all ruff linting and static analysis errors in EvoScientist/

- Fix RUF006: Implement background task tracking in Discord, iMessage, WeChat, and TUI to prevent premature GC of fire-and-forget tasks.
- Fix B904: Add explicit exception chaining (raise ... from) across all exception handlers.
- Fix RUF012: Annotate mutable class attributes with ClassVar for command arguments and media maps.
- Fix B008: Refactor Typer commands in cli/commands.py to use Annotated for argument and option defaults.
- Fix B023/B018: Resolve late-binding issues in lambdas and remove useless expressions.
- Fix syntax errors in retry.py docstrings and models.py lambda parameter ordering.
This commit is contained in:
Jan Piotrowski
2026-03-19 15:38:10 +01:00
parent 4a3d6c0318
commit 81316ffb2d
42 changed files with 331 additions and 264 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import logging
from collections import deque
from dataclasses import dataclass
from datetime import datetime
from typing import ClassVar
from ..base import Channel, ChannelError, RawIncoming
from ..capabilities import QQ as QQ_CAPS
@@ -210,7 +211,7 @@ class QQChannel(Channel):
# ── Media send ────────────────────────────────────────────────
# qq-botpy file_type constants: 1=image, 2=video, 3=audio
_FILE_TYPE_MAP = {
_FILE_TYPE_MAP: ClassVar[dict[str, int]] = {
".jpg": 1,
".jpeg": 1,
".png": 1,