mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
chore(guardrails): satisfy new base BLE001 and LIT004/LIT009 gates
The base added BLE001 (blind-except) to the strict ruleset and LIT004/LIT009 to the type-discipline checker. Suppress the intentional best-effort get_llm_provider catch with a reasoned noqa (BLE001 is in ruff external so RUF100 keeps it), and drop the inert type: ignore from the optional wonderfence_sdk imports (dead under enableTypeIgnoreComments=false; LIT009) in favor of pyright: ignore with a reason (LIT004).
This commit is contained in:
parent
c81292bcd5
commit
13f889555d
3 changed files with 5 additions and 5 deletions
|
|
@ -38,7 +38,7 @@ from .processing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from wonderfence_sdk.client import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
|
||||
from wonderfence_sdk.client import ( # pyright: ignore[reportMissingTypeStubs] # wonderfence_sdk ships no type stubs
|
||||
WonderFenceV2Client as _WonderFenceV2Client,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
from typing import TYPE_CHECKING, Any, Callable
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from wonderfence_sdk.client import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
|
||||
from wonderfence_sdk.client import ( # pyright: ignore[reportMissingTypeStubs] # wonderfence_sdk ships no type stubs
|
||||
WonderFenceV2Client as _WonderFenceV2Client,
|
||||
)
|
||||
|
||||
|
|
@ -30,10 +30,10 @@ def load_sdk() -> tuple[Any, Any]:
|
|||
on the instance so per-call hot paths don't re-trigger the import machinery.
|
||||
"""
|
||||
try:
|
||||
from wonderfence_sdk.client import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
|
||||
from wonderfence_sdk.client import ( # pyright: ignore[reportMissingTypeStubs] # wonderfence_sdk ships no type stubs
|
||||
WonderFenceV2Client,
|
||||
)
|
||||
from wonderfence_sdk.models import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
|
||||
from wonderfence_sdk.models import ( # pyright: ignore[reportMissingTypeStubs] # wonderfence_sdk ships no type stubs
|
||||
AnalysisContext,
|
||||
)
|
||||
except ImportError as e:
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ def build_analysis_context(
|
|||
if model_str:
|
||||
try:
|
||||
model_name, provider, _, _ = litellm.get_llm_provider(model=model_str)
|
||||
except Exception:
|
||||
except Exception: # noqa: BLE001 # best-effort provider parse for telemetry; any failure falls back to manual split and must never break the guardrail
|
||||
if "/" in model_str:
|
||||
provider, model_name = model_str.split("/", 1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue