[flake8-async] allow async generators (ASYNC100) (#13639)

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Treat async generators as "await" in ASYNC100.

Fixes #13637

## Test Plan

Updated snapshot
This commit is contained in:
Sid 2024-10-07 14:25:54 +02:00 committed by GitHub
parent 646e4136d7
commit 31ca1c3064
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 40 additions and 27 deletions

View file

@ -1004,6 +1004,14 @@ impl Visitor<'_> for AwaitVisitor {
crate::visitor::walk_expr(self, expr);
}
}
fn visit_comprehension(&mut self, comprehension: &'_ crate::Comprehension) {
if comprehension.is_async {
self.seen_await = true;
} else {
crate::visitor::walk_comprehension(self, comprehension);
}
}
}
/// Return `true` if a `Stmt` is a docstring.