-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Log RecursionError out as warning during inference #9614
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9614 +/- ##
==========================================
- Coverage 95.83% 95.25% -0.59%
==========================================
Files 174 174
Lines 18888 19014 +126
==========================================
+ Hits 18102 18111 +9
- Misses 786 903 +117
|
This comment has been minimized.
This comment has been minimized.
except RecursionError: | ||
warn_on_recursion_error() | ||
return {ann} if ann else set() |
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.
Maybe we should do this in astroid after all?
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit ed4fe10 |
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.
Great ! Clearly a lot of work went into this. I'm not sure New contributor or plugin maintainer will be able to keep up in new code. The exception catching around infer seem almost mandatory and not very DRY now. Maybe we could reraise an inference error with warning from astroid directly ? Or rework safe_infer / infer ?
Other than that I think it's pretty hard to know how much this will be shown in case of a problematic code base. I assume it can happens from more than once, to too much. Maybe we need an antispam limit or some ux refinement (one warning per full lint, with the number of total error ? One warning per second max ?)
No, don't worry, this went pretty fast, happy to discuss alternatives :-)
Yeah, I'm thinking we should do that after all. |
Partner to pylint-dev/astroid#2385
Type of Changes
Description
Closes #9139