You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,23 +20,23 @@ pip install flake8-trio
20
20
21
21
## List of warnings
22
22
23
-
-**TRIO100**: a`with trio.fail_after(...):` or `with trio.move_on_after(...):`
23
+
-**TRIO100**: A`with trio.fail_after(...):` or `with trio.move_on_after(...):`
24
24
context does not contain any `await` statements. This makes it pointless, as
25
25
the timeout can only be triggered by a checkpoint.
26
26
-**TRIO101**: `yield` inside a nursery or cancel scope is only safe when implementing a context manager - otherwise, it breaks exception handling.
27
-
-**TRIO102**: it's unsafe to await inside `finally:` or `except BaseException/trio.Cancelled` unless you use a shielded
27
+
-**TRIO102**: It's unsafe to await inside `finally:` or `except BaseException/trio.Cancelled` unless you use a shielded
28
28
cancel scope with a timeout.
29
29
-**TRIO103**: `except BaseException`, `except trio.Cancelled` or a bare `except:` with a code path that doesn't re-raise. If you don't want to re-raise `BaseException`, add a separate handler for `trio.Cancelled` before.
30
30
-**TRIO104**: `Cancelled` and `BaseException` must be re-raised - when a user tries to `return` or `raise` a different exception.
31
31
-**TRIO105**: Calling a trio async function without immediately `await`ing it.
32
-
-**TRIO106**: trio must be imported with `import trio` for the linter to work.
32
+
-**TRIO106**: `trio` must be imported with `import trio` for the linter to work.
33
33
-**TRIO107**: Renamed to TRIO910
34
34
-**TRIO108**: Renamed to TRIO911
35
35
-**TRIO109**: Async function definition with a `timeout` parameter - use `trio.[fail/move_on]_[after/at]` instead
36
36
-**TRIO110**: `while <condition>: await trio.sleep()` should be replaced by a `trio.Event`.
37
37
-**TRIO111**: Variable, from context manager opened inside nursery, passed to `start[_soon]` might be invalidly accessed while in use, due to context manager closing before the nursery. This is usually a bug, and nurseries should generally be the inner-most context manager.
38
-
-**TRIO112**: nursery body with only a call to `nursery.start[_soon]` and not passing itself as a parameter can be replaced with a regular function call.
39
-
-**TRIO113**: using`nursery.start_soon` in `__aenter__` doesn't wait for the task to begin. Consider replacing with `nursery.start`.
38
+
-**TRIO112**: Nursery body with only a call to `nursery.start[_soon]` and not passing itself as a parameter can be replaced with a regular function call.
39
+
-**TRIO113**: Using`nursery.start_soon` in `__aenter__` doesn't wait for the task to begin. Consider replacing with `nursery.start`.
40
40
-**TRIO114**: Startable function (i.e. has a `task_status` keyword parameter) not in `--startable-in-context-manager` parameter list, please add it so TRIO113 can catch errors when using it.
41
41
-**TRIO115**: Replace `trio.sleep(0)` with the more suggestive `trio.lowlevel.checkpoint()`.
42
42
-**TRIO116**: `trio.sleep()` with >24 hour interval should usually be`trio.sleep_forever()`.
@@ -59,8 +59,8 @@ pip install flake8-trio
59
59
60
60
### Warnings disabled by default
61
61
-**TRIO900**: Async generator without `@asynccontextmanager` not allowed.
62
-
-**TRIO910**: exit or `return` from async function with no guaranteed checkpoint or exception since function definition.
63
-
-**TRIO911**: exit, yield or return from async iterable with no guaranteed checkpoint since possible function entry (yield or function definition)
62
+
-**TRIO910**: Exit or `return` from async function with no guaranteed checkpoint or exception since function definition.
63
+
-**TRIO911**: Exit, `yield` or `return` from async iterable with no guaranteed checkpoint since possible function entry (yield or function definition)
64
64
Checkpoints are `await`, `async for`, and `async with` (on one of enter/exit).
0 commit comments