fix(proxy): drop redundant cast import to satisfy strict-ruff gate

_value_type_name already annotates its parameter as object, so the
extra cast(object, ...) wrapper and the 'cast' import are unnecessary.
This commit is contained in:
linhongyu510 2026-10-26 02:40:26 +08:00
parent e566fa2c91
commit 491c6d85fd

View file

@ -9,7 +9,7 @@ import sys
import urllib.parse as urlparse
from collections.abc import Iterable, Mapping, Sequence
from pathlib import Path
from typing import TYPE_CHECKING, Any, Final, cast
from typing import TYPE_CHECKING, Any, Final, cast # noqa: TID251 # cast is called at runtime below
import click
import httpx
@ -1312,7 +1312,7 @@ def run_server(
elif not isinstance(general_settings, dict):
raise ValueError(
"`general_settings` in the proxy config must be a mapping "
f"(got {_value_type_name(cast(object, general_settings))}). Check the "
f"(got {_value_type_name(cast(object, general_settings))}). Check the " # cast-ok: untyped YAML config; only runtime class name read for the error
"`general_settings:` block in your config file."
)
### LOAD KEY MANAGEMENT SETTINGS FIRST (needed for custom secret manager) ###