Enable ruff FURB, PERF, RSE, RET, PIE rules#2001
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables additional Ruff rule families (FURB, PERF, RSE, RET, PIE) and updates a few code paths/tests to comply with the newly enforced lint rules.
Changes:
- Expanded Ruff lint selection in
pyproject.tomlto include FURB/PERF/RSE/RET/PIE. - Applied small refactors for lint compliance (list comprehension, simplified session initialization, removed unnecessary
else,pass, and redundant returns). - Minor test dict-literal cleanup to avoid unnecessary dict spread.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| utils/generate_enums.py | Replaces an append loop with a list comprehension for parameter prototype formatting. |
| tests/test_models.py | Simplifies dict construction by removing an unnecessary **{...} spread. |
| tests/test_client.py | Removes an unnecessary pass in an async context manager exit method. |
| pyproject.toml | Enables Ruff FURB, PERF, RSE, RET, and PIE rule families. |
| pyoverkiz/client.py | Simplifies conditional session creation and removes unnecessary else after return. |
| pyoverkiz/auth/strategies.py | Removes explicit return None and simplifies a raise statement per lint rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace ternary with or operator (FURB110) - Use list comprehension instead of append loop (PERF401) - Remove unnecessary parentheses on raise (RSE102) - Remove explicit return None and unnecessary else after return (RET) - Remove unnecessary pass and dict spread (PIE)
b39346e to
3aa60b9
Compare
This file contains hidden or 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
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
oroperator (FURB110)return Noneand unnecessaryelseafterreturn(RET)passand dict spread (PIE)Test plan
ruff check .passespytest— 280 tests pass