Skip to content

Enable ruff FURB, PERF, RSE, RET, PIE rules#2001

Merged
iMicknl merged 1 commit intov2/mainfrom
v2/ruff-small-fixes
Apr 19, 2026
Merged

Enable ruff FURB, PERF, RSE, RET, PIE rules#2001
iMicknl merged 1 commit intov2/mainfrom
v2/ruff-small-fixes

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 19, 2026

Summary

  • 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)

Test plan

  • ruff check . passes
  • pytest — 280 tests pass

@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 19, 2026
Copilot AI review requested due to automatic review settings April 19, 2026 17:21
@iMicknl iMicknl requested a review from tetienne as a code owner April 19, 2026 17:21
@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.toml to 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)
@iMicknl iMicknl force-pushed the v2/ruff-small-fixes branch from b39346e to 3aa60b9 Compare April 19, 2026 17:40
@iMicknl iMicknl merged commit 764581f into v2/main Apr 19, 2026
8 checks passed
@iMicknl iMicknl deleted the v2/ruff-small-fixes branch April 19, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants