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
* doc updates. don't trigger on open_nursery in 102 (it didn't work anyway). async112 error message now specifies if its nursery or taskgroup.
* update tests
* help repro coverage bug
* Revert "help repro coverage bug"
This reverts commit 2cf2519.
* updates after review. add test cases. type tracker can now handle attribute targets.
Copy file name to clipboardExpand all lines: docs/rules.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,8 @@ ASYNC112 : useless-nursery
56
56
_`ASYNC113` : start-soon-in-aenter
57
57
Using :meth:`~trio.Nursery.start_soon`/:meth:`~anyio.abc.TaskGroup.start_soon` in ``__aenter__`` doesn't wait for the task to begin.
58
58
Consider replacing with :meth:`~trio.Nursery.start`/:meth:`~anyio.abc.TaskGroup.start`.
59
+
This will only warn about functions listed in :ref:`ASYNC114 <async114>` or known from Trio.
60
+
If you're starting a function that does not define `task_status`, then neither will trigger.
59
61
60
62
_`ASYNC114` : startable-not-in-config
61
63
Startable function (i.e. has a ``task_status`` keyword parameter) not in :ref:`--startable-in-context-manager <--startable-in-context-manager>` parameter list, please add it so ASYNC113 can catch errors when using it.
Copy file name to clipboardExpand all lines: docs/usage.rst
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,8 +265,11 @@ Example
265
265
``startable-in-context-manager``
266
266
--------------------------------
267
267
268
-
Comma-separated list of methods which should be used with :meth:`trio.Nursery.start`/:meth:`anyio.abc.TaskGroup.start` when opening a context manager,
269
-
in addition to the default :func:`trio.run_process`, :func:`trio.serve_tcp`, :func:`trio.serve_ssl_over_tcp`, and :func:`trio.serve_listeners`.
268
+
Comma-separated list of functions which should be used with :meth:`trio.Nursery.start`/:meth:`anyio.abc.TaskGroup.start` when opening a context manager.
269
+
We then add known functions from Trio to this list, namely :func:`trio.run_process`, :func:`trio.serve_tcp`, :func:`trio.serve_ssl_over_tcp`, :func:`trio.serve_listeners`, and :meth:`trio.DTLSEndpoint.serve`.
270
+
AnyIO does not have any functions in its API that defines ``task_status``.
271
+
asyncio does not have an equivalent of :meth:`~trio.Nursery.start`, nor ``task_status``, but you could still add functions to this list that you want to be extra careful about when opening in an `asyncio.TaskGroup` in an ``__aenter__``
272
+
270
273
Names must be valid identifiers as per :meth:`str.isidentifier`.
271
274
Used by :ref:`ASYNC113 <async113>`, and :ref:`ASYNC114 <async114>` will warn when encountering methods not in the list.
0 commit comments