- Added :ref:`ASYNC914 <async914>` redundant-lowlevel-checkpoint.
- :ref:`ASYNC910 <async910>`, :ref:`ASYNC911 <async911>` and :ref:`ASYNC913 <async913>` can now autofix asyncio code by inserting asyncio.await(0).
- :ref:`ASYNC102 <async102>` no longer triggered for asyncio due to different cancellation semantics it uses.
- :ref:`ASYNC115 <async115>` and :ref:`ASYNC116 <async116>` now also checks kwargs.
- :ref:`ASYNC102 <async102>` and :ref:`ASYNC120 <async120>` no longer requires cancel scopes to have a timeout. (issue #272)
- Add :ref:`ASYNC400 <async400>` except-star-invalid-attribute.
- Fixed :ref:`ASYNC113 <async113>` false alarms if the
start_sooncalls are in a nursery cm that was closed before the yield point.
- :ref:`ASYNC900 <async900>` now accepts and recommends :func:`trio.as_safe_channel`.
- :ref:`ASYNC100 <async100>` can now autofix
withstatements with multiple items. - Fixed a bug where multiple
withitems would not interact, leading to ASYNC100 and ASYNC9xx false alarms. (issue #367)
- Add :ref:`ASYNC125 <async125>` constant-absolute-deadline.
- Add match-case (structural pattern matching) support to ASYNC103, 104, 910, 911 & 912.
- Add except* support to ASYNC102, 103, 104, 120, 910, 911, 912.
- No longer require
flake8for installation... so if you require support for config files you must installflake8-async[flake8].
- :ref:`ASYNC113 <async113>` now only triggers on
trio.[serve_tcp, serve_ssl_over_tcp, serve_listeners, run_process], instead of accepting anything as the attribute base. (e.g. :func:`anyio.run_process` is not startable).
- :ref:`ASYNC912 <async912>` and :ref:`ASYNC913 <async913>` will now trigger if there's no cancel points. This means that :func:`trio.open_nursery`/anyio.create_task_group will not silence them on their own, unless they're guaranteed to start tasks.
- Add :ref:`ASYNC124 <async124>` async-function-could-be-sync
- :ref:`ASYNC91x <ASYNC910>` now correctly handles
await()in parameter lists. - Fixed a bug with :ref:`ASYNC91x <ASYNC910>` and nested empty functions.
- :ref:`ASYNC100 <async100>` once again ignores :func:`trio.open_nursery` and :func:`anyio.create_task_group`, unless we find a call to
.start_soon().
- Revert :ref:`ASYNC100 <async100>` ignoring :func:`trio.open_nursery` and :func:`anyio.create_task_group` due to it not viewing
.start_soon()as introducing a :ref:`cancel point <cancel_point>`.
- Fix crash in
Visitor91xonasync with a().b():.
- :ref:`ASYNC100 <async100>` now ignores :func:`trio.open_nursery` and :func:`anyio.create_task_group` as cancellation sources, because they are :ref:`schedule points <schedule_point>` but not :ref:`cancellation points <cancel_point>`.
- :ref:`ASYNC101 <async101>` and :ref:`ASYNC119 <async119>` are now silenced for decorators in :ref:`transform-async-generator-decorators`.
- :ref:`ASYNC102 <async102>` now also warns about
await()inside__aexit__.
- Add :ref:`ASYNC123 <async123>` bad-exception-group-flattening.
- Fix crash when analyzing code with infinite loop inside context manager.
- Add :ref:`ASYNC122 <async122>` delayed-entry-of-relative-cancelscope.
- :ref:`ASYNC102 <async102>` and :ref:`ASYNC120 <async120>`: - handles nested cancel scopes - detects internal cancel scopes of nurseries as a way to shield&deadline - no longer treats :func:`trio.open_nursery` or :func:`anyio.create_task_group` as cancellation sources - handles the shield parameter to :func:`trio.fail_after` and friends (added in trio 0.27)
- Fix false alarm in :ref:`ASYNC113 <async113>` and :ref:`ASYNC121 <async121>` with sync functions nested inside an async function.
- Add :ref:`ASYNC121 <async121>` control-flow-in-taskgroup.
- Add config option :ref:`transform-async-generator-decorators`, to list decorators which suppress :ref:`ASYNC900 <async900>`.
- Add :ref:`ASYNC120 <async120>` await-in-except.
- Fix false alarm with :ref:`ASYNC102 <async102>` with function definitions inside finally/except.
- Make :ref:`ASYNC913 <async913>` disabled by default, as originally intended.
- Add :ref:`ASYNC300 <async300>` create-task-no-reference.
- Add :ref:`ASYNC913 <async913>`: Indefinite loop with no guaranteed checkpoint.
- Fix bugs in :ref:`ASYNC910 <async910>` and :ref:`ASYNC911 <async911>` autofixing where they sometimes didn't add a library import.
- Fix crash in :ref:`ASYNC911 <async911>` when trying to autofix a one-line
while ...: yield - Add :ref:`exception-suppress-context-managers`. Contextmanagers that may suppress exceptions.
- :ref:`ASYNC91x <ASYNC910>` now treats checkpoints inside
with contextlib.suppressas unreliable.
- Rename config option
trio200-blocking-callsto :ref:`async200-blocking-calls`. trio200-blocking-callsis now deprecated.
- ASYNC101 now also warns on anyio & asyncio taskgroups.
- Fixed a bug where ASYNC101 and ASYNC91x would not recognize decorators with parameters directly imported. I.e.
@fixture(...)will now suppress errors.
- Add ASYNC912: no checkpoints in with statement are guaranteed to run.
- ASYNC100 now properly treats async for comprehensions as checkpoints.
- ASYNC100 now supports autofixing on asyncio.
- Add ASYNC119: yield in contextmanager in async generator.
- ASYNC91X: fix internal error caused by multiple
try/exceptincorrectly sharing state.
- ASYNC100 no longer triggers if a context manager contains a
yield.
- ASYNC102 (no await inside finally or critical except) no longer raises warnings for calls to
aclose()on objects in trio/anyio code. See (issue #156)
- ASYNC110 (don't loop sleep) now also warns if looping
[trio/anyio].lowlevel.checkpoint().
- Add ASYNC251:
time.sleep()in async method.
- Add ASYNC250: blocking sync call
input()in async method.
- Removed TRIO117, MultiError removed in trio 0.24.0
- Renamed the library from flake8-trio to flake8-async, to indicate the checker supports more than just
trio. - Renamed all error codes from TRIOxxx to ASYNCxxx
- Renamed the binary from flake8-trio to flake8-async
- Lots of internal renaming.
- Added asyncio support for several error codes
- added
--library
- TRIO91X now supports comprehensions
- TRIO100 and TRIO91X now supports autofixing
- Renamed
--enable-visitor-codes-regexto--enable - Added
--disable,--autofixand--error-on-autofix
- Fix false alarms for
@pytest.fixture-decorated functions in TRIO101, TRIO910 and TRIO911
- Fix TRIO900 false alarm on nested functions
- TRIO113 now also works on
anyio.TaskGroup
- Fix
get_matching_callwhen passed a single string as base. Resolves possibly several false alarms, TRIO210 among them.
- Rename TRIO107 to TRIO910, and TRIO108 to TRIO911, and making them optional by default.
- Allow
@pytest.fixture()-decorated async generators, since they're morally context managers - Add support for checking code written against AnyIO
- Add TRIO118: Don't assign the value of
anyio.get_cancelled_exc_class()to a variable, since that breaks linter checks and multi-backend programs.
- TRIO103 and TRIO104 no longer triggers when
trio.Cancelledhas been handled in previous except handlers. - Add TRIO117: Reference to deprecated
trio.[NonBase]MultiError; use[Base]ExceptionGroupinstead. - Add TRIO232: blocking sync call on file object.
- Add TRIO212: blocking sync call on
httpx.Clientobject. - Add TRIO222: blocking sync call to
os.wait* - TRIO221 now also looks for
os.posix_spawn[p]
- TRIO114 avoids a false alarm on posonly args named "task_status"
- TRIO116 will now match on any attribute parameter named
.inf, not justmath.inf. - TRIO900 now only checks
@asynccontextmanager, not other decorators passed with --no-checkpoint-warning-decorators.
- Add TRIO240: usage of
os.pathin async function. - Add TRIO900: ban async generators not decorated with known safe decorator
- Add TRIO230, TRIO231 - sync IO calls in async function
- Add TRIO210, TRIO211 - blocking sync call in async function, using network packages (requests, httpx, urllib3)
- Add TRIO220, TRIO221 - blocking sync call in async function, using subprocess or os.
- The
--startable-in-context-managerand--trio200-blocking-callsoptions now handle spaces and newlines. - Now compatible with flake8-noqa NQA102 and NQA103 checks.
- TRIO200 no longer warns on directly awaited calls
- Worked around configuration-parsing bug for TRIO200 warning (more to come)
- Add TRIO200: User-configured blocking sync call in async function
- TRIO114 will now trigger on the unqualified name, will now only check the first parameter directly, and parameters to function calls inside that.
- TRIO113 now only supports names that are valid identifiers, rather than fnmatch patterns.
- Add TRIO115: Use
trio.lowlevel.checkpoint()instead oftrio.sleep(0).
- Add TRIO116:
trio.sleep()with >24 hour interval should usually betrio.sleep_forever().
- Add TRIO114 Startable function not in
--startable-in-context-managerparameter list.
- Add TRIO113, prefer
await nursery.start(...)tonursery.start_soon()for compatible functions when opening a context manager
- TRIO105 now also checks that you
awaitednursery.start().
- TRIO102 is no longer skipped in (async) context managers, since it's not a missing-checkpoint warning.
- Fix a crash on nontrivial decorator expressions (calls, PEP 614) and document behavior.
- Add
--no-checkpoint-warning-decoratorsoption, to disable missing-checkpoint warnings for certain decorated functions.
- Fix false alarm on TRIO107 with checkpointing
tryand emptyfinally - Fix false alarm on TRIO107&108 with infinite loops
- TRIO107+108 now ignores
asynccontextmanager`s, since both `__aenter__and__aexit__should checkpoint.async withis also treated as checkpointing on both enter and exit. - TRIO107 now completely ignores any function whose body consists solely of ellipsis, pass, or string constants.
- TRIO103, 107 and 108 now inspects
whileconditions andforiterables to avoid false alarms on a couple cases where the loop body is guaranteed to run at least once.
- TRIO103 now correctly handles raises in loops, i.e.
raisein else is guaranteed to run unless there's abreakin the body.
- Add 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. - Add TRIO112: this single-task nursery could be replaced by awaiting the function call directly.
- Fix TRIO108 raising errors on yields in some sync code.
- TRIO109 now skips all decorated functions to avoid false alarms
- TRIO108 now gives multiple error messages; one for each path lacking a guaranteed checkpoint
- Merged TRIO108 into TRIO107
- TRIO108 now handles checkpointing in async iterators
- Added TRIO109: Async definitions should not have a
timeoutparameter. Usetrio.[fail/move_on]_[at/after] - Added TRIO110:
while <condition>: await trio.sleep()should be replaced by atrio.Event.
- Extend TRIO102 to also check inside
except BaseExceptionandexcept trio.Cancelled - Extend TRIO104 to also check for
yield - Update error messages on TRIO102 and TRIO103
- Add TRIO103:
except BaseExceptionorexcept trio.Cancelledwith a code path that doesn't re-raise - Add TRIO104: "Cancelled and BaseException must be re-raised" if user tries to return or raise a different exception.
- Added TRIO107: Async functions must have at least one checkpoint on every code path, unless an exception is raised
- Added TRIO108: Early return from async function must have at least one checkpoint on every code path before it.
- Added TRIO105 check for not immediately
awaiting async trio functions. - Added TRIO106 check that trio is imported in a form that the plugin can easily parse.
- Added TRIO102 check for unsafe checkpoints inside
finally:blocks
- Avoid
TRIO100false-alarms on cancel scopes containingasync fororasync with.
- Initial release with TRIO100 and TRIO101