From cb91589363ce1d2ce824b7cd87eb7f50ba4da1ad Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 10 Aug 2026 23:18:40 +0200 Subject: [PATCH] Enforce that spawned asyncio tasks are kept referenced RUF006 catches a create_task whose result is discarded. The loop holds only a weak reference, so such a task can be collected while still pending and the work disappears without a trace. Selected last, once the three existing offenders are gone, so the tree stays clean under it from this commit on. --- ruff.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruff.toml b/ruff.toml index bf49679c..a051d317 100644 --- a/ruff.toml +++ b/ruff.toml @@ -76,6 +76,9 @@ select = [ "B023", # closure captures a loop variable, so every closure sees the # last value rather than the one from its iteration "B035", # dict comprehension with a static key + "RUF006", # asyncio.create_task result discarded. The loop keeps only a + # weak reference, so an unreferenced task can be collected + # while it is still pending, and the work is silently dropped ] # Deliberately not selected, though currently at zero: B905 (zip without an