-
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
[pylint
] Implement useless-exception-statement
(W0133
)
#10176
Merged
charliermarsh
merged 5 commits into
astral-sh:main
from
mikeleppane:rule(pylint)/useless_exception_statement_PLW0133
Mar 1, 2024
Merged
[pylint
] Implement useless-exception-statement
(W0133
)
#10176
charliermarsh
merged 5 commits into
astral-sh:main
from
mikeleppane:rule(pylint)/useless_exception_statement_PLW0133
Mar 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLW0133 | 2 | 2 | 0 | 0 | 0 |
Formatter (stable)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
Formatter (preview)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
ruff format --preview
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
False positive for custom exception class using initializer: |
charliermarsh
added
rule
Implementing or modifying a lint rule
preview
Related to preview mode features
labels
Mar 1, 2024
charliermarsh
changed the title
rule(PLW0133): Implement useless exception statement
[Mar 1, 2024
pylint
] Implement useless-exception-statement
(W0133
)
Reviewing now... |
nkxxll
pushed a commit
to nkxxll/ruff
that referenced
this pull request
Mar 10, 2024
…sh#10176) ## Summary This review contains a new rule for handling `useless exception statements` (`PLW0133`). Is it based on the following pylint's rule: [W0133](https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/pointless-exception-statement.html) Note: this rule does not cover the case if an error is a custom exception class. See: [Rule request](astral-sh#10145) ## Test Plan ```bash cargo test & manually ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This review contains a new rule for handling
useless exception statements
(PLW0133
). Is it based on the following pylint's rule: W0133Note: this rule does not cover the case if an error is a custom exception class.
See: Rule request
Test Plan