-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add check for async context managers used with regular with
#10575
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
Conversation
Signed-off-by: Emmanuel Ferdman <[email protected]>
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10575 +/- ##
=======================================
Coverage 95.91% 95.91%
=======================================
Files 176 176
Lines 19458 19463 +5
=======================================
+ Hits 18663 18668 +5
Misses 795 795
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work !
Signed-off-by: Emmanuel Ferdman <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what the primer tells us and wait for another maintainer opinion before merging :)
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 500c0e8 |
Type of Changes
Description
This PR adds a new pylint check
async-context-manager-with-regular-with
(E1145) that provides clearer error message when async context managers are incorrectly used with regularwith
statements instead ofasync with
. Previously, users would see the generic error:which was confusing and didn't clearly indicate the solution. The new check specifically detects when an
AsyncGenerator
decorated with@asynccontextmanager
is used withwith
and provides an actionable error message:Example:
will return:
Closes #10408