These tests are currently hardcoded to check for nurseries, but should be extended to also check anyio taskgroups. The same errors are likely relevant for asyncio as well, so can extend to asyncio taskgroups too.
Errors in question are:
ASYNC101: yield inside a trio/anyio nursery or cancel scope is only safe when implementing a context manager - otherwise, it breaks exception handling.
ASYNC111: 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.
ASYNC112: 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.
It's possible there are other checks where I've missed the nursery/taskgroup distinction, I'll make a pass to check for any other that seem to only handle nurseries when writing PR for the above.
These tests are currently hardcoded to check for nurseries, but should be extended to also check anyio taskgroups. The same errors are likely relevant for asyncio as well, so can extend to asyncio taskgroups too.
Errors in question are:
yield
inside a trio/anyio nursery or cancel scope is only safe when implementing a context manager - otherwise, it breaks exception handling.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.nursery.start[_soon]
and not passing itself as a parameter can be replaced with a regular function call.