Repository navigation
Suppress ASYNC910/911 when ASYNC124 fires (issue #313) - #477
Open
VedantBhayani wants to merge 3 commits into
Open
VedantBhayani wants to merge 3 commits into
VedantBhayani wants to merge 3 commits into
Conversation
jakkdl
reviewed
Oct 9, 2026
| ) | ||
|
|
||
|
|
||
| def func_has_await(node: cst.FunctionDef) -> bool: |
Member
There was a problem hiding this comment.
you're adding a lot of code that duplicates the existing logic of async124, which is very bad in case they were ever to diverge. There's way better ways of tackling this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #313 - ASYNC910/911 ("no checkpoint") were incorrectly firing on functions that ASYNC124 already flags as "could be sync" (no awaits).
Changes
flake8_async/visitors/visitor91x.py: Added await/checkpoint detection (func_has_await,_AwaitFinderVisitor), suppress ASYNC910/911 when function has zero awaits (ASYNC124 fires instead). Class methods still get ASYNC910/911 (ASYNC124 ignores class methods).tests/eval_files/async124.pytests/eval_files/async910.pytests/eval_files/async911.pytests/eval_files/async913.pyTesting
Fixes #313.