Skip to content

[py] cleanup for ruff rule sim102 . part of the tranche 3 stage - #18034

Merged
iampopovich merged 9 commits into
SeleniumHQ:trunkfrom
iampopovich:py-ruff-tranche3-sim102
Oct 14, 2026
Merged

iampopovich merged 9 commits into
SeleniumHQ:trunkfrom
iampopovich:py-ruff-tranche3-sim102

Conversation

@iampopovich

Copy link
Copy Markdown
Contributor

🔗 Related Issues

partially resolves #17989

💥 What does this PR do?

fixes warnings for ruff rule sim102. it was choosen by me as mostly easy to implement with non-breaking changes

🔧 Implementation Notes

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): claude code + sonnet 5 medium effort / github copilot
    • What was generated: semantic analysis for nested if conditions + commit messages
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)

@selenium-ci selenium-ci added the C-py Python Bindings label Sep 14, 2026
@iampopovich
iampopovich marked this pull request as ready for review September 14, 2026 22:43
Copilot AI lite review requested due to automatic review settings September 14, 2026 22:43
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved issues were identified.

Pull request overview

This PR enables Ruff SIM102 and simplifies equivalent nested conditionals across five Python files without intended behavior changes.

Changes:

  • Adds SIM102 to Ruff enforcement.
  • Flattens nested conditional logic.
File summaries
File Summary
py/selenium/webdriver/remote/server.py Simplifies version validation.
py/selenium/webdriver/firefox/firefox_profile.py Simplifies namespace detection.
py/pyproject.toml Enables SIM102.
py/generate_api_module_listing.py Simplifies module filtering.
py/conftest.py Simplifies traceback, BiDi, and teardown conditions.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@iampopovich

Copy link
Copy Markdown
Contributor Author

@cgoldberg please review. I'm going to continue working on the root issue with the remaining Ruff warnings.

@cgoldberg cgoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@iampopovich I think this is good to merge

@iampopovich

Copy link
Copy Markdown
Contributor Author

@cgoldberg thanks, in the end of this week I'll take the next batch of warnings to fix

@iampopovich
iampopovich merged commit 6fc1c2b into SeleniumHQ:trunk Oct 14, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[py] Adopt selected ruff rule families surfaced by ruff 0.16

4 participants

Sponsor
SponsoredKunjungi sekarang
Promo