mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-09 14:36:44 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user