ci/typecheck: clear slash.py basedpyright warnings

Raise BadParameter instead of fail()+return; drop unnecessary pyright ignore.
This commit is contained in:
2026-07-15 13:06:21 +08:00
parent 5b0c9be90b
commit 972bcd78ee
+3 -3
View File
@@ -56,8 +56,8 @@ class OnOffParam(click.ParamType[bool]):
return True return True
if token in {"off", "0", "false", "no"}: if token in {"off", "0", "false", "no"}:
return False return False
self.fail("expected on or off", param, ctx) msg = "expected on or off"
return False raise click.BadParameter(msg, ctx=ctx, param=param)
ON_OFF = OnOffParam() ON_OFF = OnOffParam()
@@ -95,7 +95,7 @@ def slash_command_names() -> list[str]:
def _await[T](awaitable: Awaitable[T]) -> T: def _await[T](awaitable: Awaitable[T]) -> T:
# Greenlet parks until the awaitable completes on the running loop. # Greenlet parks until the awaitable completes on the running loop.
return awaitlet.awaitlet(awaitable) # pyright: ignore[reportUnknownVariableType] return awaitlet.awaitlet(awaitable)
# --- commands ----------------------------------------------------------------- # --- commands -----------------------------------------------------------------