-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Suggestion to use bare raise
instead of raise exc
#4333
Comments
As I understand it, this is covered by tryceratops and is implemented in ruff as |
Thanks for the clear issue :) My read is that this is covered by |
Cool! I'm interested in adding explanation there as they call it "redundant" but it has an actual runtime effect. What kind of criteria is there for a rule being included by default? I've noticed this is also not an auto-fixable issue but it seems like it could be
|
Hi @zanieb and @charliermarsh, I would also enjoy seeing this rule become auto-fixable. |
## Summary Make `TRY201` always autofiable. ## Test Plan 1. `cargo test` 2. `cargo insta review` ref: #4333 (comment)
I've been championing the use of
raise
instead ofraise exc
when re-raising a captured exception as it removes a frame from the traceback. When many exceptions are chained, this can make a significant difference in the length of a traceback.WRONG: Extra frame included in traceback
RIGHT: No frame added when the exception is re-raised
I don't think this is covered by any existing linters. I checked
flake8
andpylint
.The text was updated successfully, but these errors were encountered: