Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add asyncio and anyio support to ASYNC1XX #12039

Closed
MichaReiser opened this issue Jun 26, 2024 · 0 comments · Fixed by #12262
Closed

Add asyncio and anyio support to ASYNC1XX #12039

MichaReiser opened this issue Jun 26, 2024 · 0 comments · Fixed by #12262
Labels
rule Implementing or modifying a lint rule

Comments

@MichaReiser
Copy link
Member

The ASYNC1xx rules used to be trio specific rules, but the upstream flake8-async rules now also cover asyncio and anyio (see #10416 for when we recoded the trio rules to flake8-async).

We should update

  • ASYNC100
  • ASYNC109
  • ASYNC110
  • ASYNC115

To also cover anyio and asyncio to match the upstream rule's behavior.

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Jun 26, 2024
charliermarsh pushed a commit that referenced this issue Jul 9, 2024
## Summary

Update the name of `ASYNC109` to match
[upstream](https://flake8-async.readthedocs.io/en/latest/rules.html).

Also update to the functionality to match upstream by supporting
additional context managers from `asyncio` and `anyio`. This doesn't
change any of the detection functionality, but recommends additional
context managers from `asyncio` and `anyio` depending on context.

Part of #12039.

## Test Plan

Added fixture for asyncio recommendation
charliermarsh pushed a commit that referenced this issue Jul 9, 2024
## Summary

Update the name of `ASYNC100` to match
[upstream](https://flake8-async.readthedocs.io/en/latest/rules.html).

Also update to the functionality to match upstream by supporting
additional context managers from asyncio and anyio. Matching this
[list](https://flake8-async.readthedocs.io/en/latest/glossary.html#timeout-context).

Part of #12039.

## Test Plan

Added the new context managers to the fixture.
charliermarsh pushed a commit that referenced this issue Jul 10, 2024
## Summary

Update the name of `ASYNC110` to match
[upstream](https://flake8-async.readthedocs.io/en/latest/rules.html).

Also update to the functionality to match upstream by adding support for
`asyncio` and `anyio` (gated behind preview).

Part of #12039.

## Test Plan

Added tests for `asyncio` and `anyio`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant