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:
lior-k 2026-07-05 16:29:41 +03:00
parent c81292bcd5
commit 13f889555d
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View file

@ -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,
)

View file

@ -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:

View file

@ -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)