- Add ASYNC912: no checkpoints in with statement are guaranteed to run.
- 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 python-trio#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_call when 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's 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
asynccontextmanagers, 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