Skip to content

The agent that grows with you

ci: RUF009

Maciej Lisiewski46f7b999e68a
diff --git a/ruff.strict.toml b/ruff.strict.toml
index 6bc60acf826..1675fdfef9b 100644
--- a/ruff.strict.toml
+++ b/ruff.strict.toml
@@ -414,7 +414,7 @@ select = [
# "FURB192",
"RUF007",
"RUF008",
- # "RUF009",
+ "RUF009",
"RUF010",
# "RUF012",
"RUF013",
diff --git a/tools/mcp_dashboard_oauth.py b/tools/mcp_dashboard_oauth.py
index 37bd86cb3b2..8ff229a906c 100644
--- a/tools/mcp_dashboard_oauth.py
+++ b/tools/mcp_dashboard_oauth.py
@@ -28,10 +28,6 @@ def contextvar_set(var: contextvars.ContextVar, value) -> Iterator[None]:
var.reset(token)
-def _event_field():
- return field(default_factory=threading.Event, init=False, repr=False)
-
-
def exception_message(exc: BaseException) -> str:
"""``str(exc)``, or the type name when it is empty (bare ``TimeoutError()``/``RuntimeError()``)
so ``mark_error`` never records a blank cause."""
@@ -57,9 +53,9 @@ class DashboardOAuthFlow:
expected_state: str | None = field(default=None, init=False)
_callback: tuple[str, str | None, str | None] | None = field(default=None, init=False, repr=False)
_callback_error: str | None = field(default=None, init=False, repr=False)
- _authorization_ready: threading.Event = _event_field()
- _callback_ready: threading.Event = _event_field()
- _worker_done: threading.Event = _event_field()
+ _authorization_ready: threading.Event = field(default_factory=threading.Event, init=False, repr=False)
+ _callback_ready: threading.Event = field(default_factory=threading.Event, init=False, repr=False)
+ _worker_done: threading.Event = field(default_factory=threading.Event, init=False, repr=False)
_lock: threading.Lock = field(default_factory=threading.Lock, init=False, repr=False)
async def publish_authorization_url(self, url: str) -> None: