-
Notifications
You must be signed in to change notification settings - Fork 27
Switch from flake8 to ruff for linting #641
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
Conversation
WalkthroughThe pull request migrates the linting toolchain from flake8 to ruff across configuration files and GitHub Actions workflow, while also replacing strict type comparisons with isinstance checks for improved Python compatibility and subclass handling in two locations. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ttypic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pyproject.toml (1)
47-58: Ruff dev dependency and config align with prior linting setupAdding
ruffto thedevextra and configuring[tool.ruff]/[tool.ruff.lint]to selectE,W,F,N(while ignoringN818andF401in__init__.py) cleanly mirrors the previous flake8/pep8-naming behavior. Theextend-excludeandline-length = 115choices also look consistent with the existing codebase.One thing to double-check: ensure the
ruff>=0.14.0,<1.0.0version range matches the versions actually available/used in your CI and local environments so installs don’t fail or unexpectedly jump versions.Also applies to: 82-97
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/lint.yml(1 hunks)ably/util/crypto.py(1 hunks)pyproject.toml(2 hunks)setup.cfg(0 hunks)test/ably/rest/restchannelpublish_test.py(1 hunks)
💤 Files with no reviewable changes (1)
- setup.cfg
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: check (3.9)
- GitHub Check: check (3.13)
- GitHub Check: check (3.10)
- GitHub Check: check (3.11)
- GitHub Check: check (3.12)
- GitHub Check: check (3.7)
- GitHub Check: check (3.8)
🔇 Additional comments (3)
test/ably/rest/restchannelpublish_test.py (1)
423-427: Interoperability history check: isinstance use is appropriateSwitching from a strict
type(...)equality toisinstance(message.data, type_mapping[expected_type])is more idiomatic and correctly handles subclasses without changing expected behavior for the currenttype_mapping. Looks good.ably/util/crypto.py (1)
144-161: get_default_params: isinstance for string keys is an improvementUsing
isinstance(key, str)instead oftype(key) == stris more Pythonic and correctly handlesstrsubclasses for base64 decoding. Only behavioral change is that subclassed strings now go throughb64decode, which is likely desired but worth keeping in mind if any callers relied on the old behavior..github/workflows/lint.yml (1)
34-37: CI lint job correctly migrated to RuffUsing
uv sync --extra devfollowed byuv run ruff checkcleanly switches the workflow to Ruff and should honor the new pyproject-based configuration without extra flags.
ruff is faster and better :)
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.