Skip to content

[flake8-async] Update ASYNC100 to match upstream#12221

Merged
charliermarsh merged 4 commits intoastral-sh:mainfrom
augustelalande:async100
Jul 9, 2024
Merged

[flake8-async] Update ASYNC100 to match upstream#12221
charliermarsh merged 4 commits intoastral-sh:mainfrom
augustelalande:async100

Conversation

@augustelalande
Copy link
Copy Markdown
Contributor

@augustelalande augustelalande commented Jul 7, 2024

Summary

Update the name of ASYNC100 to match upstream.

Also update to the functionality to match upstream by supporting additional context managers from asyncio and anyio. Matching this list.

Part of #12039.

Test Plan

Added the new context managers to the fixture.

@MichaReiser MichaReiser added rule Implementing or modifying a lint rule preview Related to preview mode features labels 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.

Awesome, thank you!

I think we should gate this change behind preview because it changes the scope of the rule.

@augustelalande
Copy link
Copy Markdown
Contributor Author

Not super straight forward to gate since it's just detecting a few additional context managers. I think there's precedence for not gating when just detecting more functions, e.g., #12065

@MichaReiser
Copy link
Copy Markdown
Member

The way this differs in my view from the numpy rule is that the NumPy rule was made more complete by including more of the deprecated methods. This PR introduces support for entire new async libraries, which extends the scope of the rule. @zanieb what's your take on this?

@augustelalande
Copy link
Copy Markdown
Contributor Author

Ok no problem. I did the gating.

Copy link
Copy Markdown
Member

@charliermarsh charliermarsh 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!

@charliermarsh charliermarsh enabled auto-merge (squash) July 9, 2024 17:52
@charliermarsh charliermarsh merged commit 88abc6a into astral-sh:main Jul 9, 2024
@augustelalande augustelalande deleted the async100 branch July 9, 2024 17:59
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