From 972bcd78eeb7b422bfbf171f90e48e59fd16e709 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Wed, 15 Jul 2026 13:06:21 +0800 Subject: [PATCH] ci/typecheck: clear slash.py basedpyright warnings Raise BadParameter instead of fail()+return; drop unnecessary pyright ignore. --- src/plyngent/cli/slash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plyngent/cli/slash.py b/src/plyngent/cli/slash.py index 84ad986..dc96a84 100644 --- a/src/plyngent/cli/slash.py +++ b/src/plyngent/cli/slash.py @@ -56,8 +56,8 @@ class OnOffParam(click.ParamType[bool]): return True if token in {"off", "0", "false", "no"}: return False - self.fail("expected on or off", param, ctx) - return False + msg = "expected on or off" + raise click.BadParameter(msg, ctx=ctx, param=param) ON_OFF = OnOffParam() @@ -95,7 +95,7 @@ def slash_command_names() -> list[str]: def _await[T](awaitable: Awaitable[T]) -> T: # Greenlet parks until the awaitable completes on the running loop. - return awaitlet.awaitlet(awaitable) # pyright: ignore[reportUnknownVariableType] + return awaitlet.awaitlet(awaitable) # --- commands -----------------------------------------------------------------