Skip to content

[flake8-async] Update ASYNC109 to match upstream#12236

Merged
charliermarsh merged 6 commits intoastral-sh:mainfrom
augustelalande:async109
Jul 9, 2024
Merged

[flake8-async] Update ASYNC109 to match upstream#12236
charliermarsh merged 6 commits intoastral-sh:mainfrom
augustelalande:async109

Conversation

@augustelalande
Copy link
Copy Markdown
Contributor

@augustelalande augustelalande commented Jul 8, 2024

Summary

Update the name of ASYNC109 to match upstream.

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

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Jul 8, 2024
Copy link
Copy Markdown
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This looks good to me.

The only change is that I think we should gate this behind preview-mode because it increases the scope of a non-preview rule.

Would you mind to extend the PR summary with a short explanation of what "match upstream" means (support anyio and asyncio). The person who has to write the changelog and people navigating to the PR from the changelog might find that helpful.

@augustelalande
Copy link
Copy Markdown
Contributor Author

Ok I restricted the rule to trio only unless preview is enabled

@augustelalande
Copy link
Copy Markdown
Contributor Author

I expanded the PR summary to make things a little clearer.

@charliermarsh charliermarsh self-assigned this Jul 9, 2024
@charliermarsh charliermarsh added the preview Related to preview mode features label Jul 9, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) July 9, 2024 04:10
@charliermarsh charliermarsh merged commit 16a63c8 into astral-sh:main Jul 9, 2024
@augustelalande augustelalande deleted the async109 branch July 9, 2024 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants