8000 Extend 107 and 108 to handle async iterators · python-trio/flake8-async@6cde589 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cde589

Browse files
committed
Extend 107 and 108 to handle async iterators
1 parent b53e5fa commit 6cde589

File tree

10 files changed

+1107
-161
lines changed

10 files changed

+1107
-161
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
*[CalVer, YY.month.patch](https://calver.org/)*
33

4+
## Future
5+
- Extend TRIO107 and 108 to also handle yields
6+
47
## 22.7.6
58
- Extend TRIO102 to also check inside `except BaseException` and `except trio.Cancelled`
69
- Extend TRIO104 to also check for `yield`

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ pip install flake8-trio
2828
- **TRIO104**: `Cancelled` and `BaseException` must be re-raised - when a user tries to `return` or `raise` a different exception.
2929
- **TRIO105**: Calling a trio async function without immediately `await`ing it.
3030
- **TRIO106**: trio must be imported with `import trio` for the linter to work.
31-
- **TRIO107**: Async functions must have at least one checkpoint on every code path, unless an exception is raised.
32-
- **TRIO108**: Early return from async function must have at least one checkpoint on every code path before it, unless an exception is raised.
33-
Checkpoints are `await`, `async with` `async for`.
31+
- **TRIO107**: Async functions and iterables must have at least one checkpoint on every code path, unless an exception is raised.
32+
- **TRIO108**: `return` or `yield` from async function must have at least one checkpoint on every code path before it, unless an exception is raised.
33+
Checkpoints are `await`, `async for`, and `async with` (on one of enter/exit).

0 commit comments

Comments
 (0)
0