Skip to content

Commit 358df6d

Browse files
committed
add async914, add asyncio autofix to 910, 911 & 913
1 parent 5cd55a2 commit 358df6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2568
-1625
lines changed

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Changelog
44

55
`CalVer, YY.month.patch <https://calver.org/>`_
66

7+
25.8.1
8+
======
9+
- Added :ref:`ASYNC914 <async914>` redundant-lowlevel-checkpoint.
10+
- :ref:`ASYNC910`, :ref:`ASYNC911` and :ref:`ASYNC913` can now autofix asyncio code by inserting `asyncio.await(0)`.
11+
712
25.7.1
813
======
914
- :ref:`ASYNC102 <async102>` no longer triggered for asyncio due to different cancellation semantics it uses.

docs/rules.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ _`ASYNC913` : indefinite-loop-no-guaranteed-checkpoint
220220
An indefinite loop (e.g. ``while True``) has no guaranteed :ref:`checkpoint <checkpoint>`. This could potentially cause a deadlock.
221221
This will also error if there's no guaranteed :ref:`cancel point <cancel_point>`, where even though it won't deadlock the loop might become an uncancelable dry-run loop.
222222

223+
_`ASYNC914`: redundant-lowlevel-checkpoint
224+
Warns on calls to :func:`trio.lowlevel.checkpoint`, :func:`anyio.lowlevel.checkpoint` and :func:`asyncio.sleep` that are not required to satisfy `ASYNC910`_, `ASYNC911`_ and `ASYNC912`_.
225+
Excessive calls to the scheduler will impact performance, and bloat the code, but sometimes you do want to trigger checkpoints at specific points and can safely ignore this warning.
226+
223227
.. _autofix-support:
224228

225229
Autofix support

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ adding the following to your ``.pre-commit-config.yaml``:
3333
minimum_pre_commit_version: '2.9.0'
3434
repos:
3535
- repo: https://github.com/python-trio/flake8-async
36-
rev: 25.7.1
36+
rev: 25.8.1
3737
hooks:
3838
- id: flake8-async
3939
# args: ["--enable=ASYNC100,ASYNC112", "--disable=", "--autofix=ASYNC"]

flake8_async/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
# CalVer: YY.month.patch, e.g. first release of July 2022 == "22.7.1"
41-
__version__ = "25.7.1"
41+
__version__ = "25.8.1"
4242

4343

4444
# taken from https://github.com/Zac-HD/shed

0 commit comments

Comments
 (0)