-
Notifications
You must be signed in to change notification settings - Fork 28
chore: use ruff for linting and formatting #246
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
- Add ruff to dev dependencies - Configure ruff in pyproject.toml to match Google style - Add ruff linting to CI alongside pylint - Replace yapf with ruff format in CI - Remove yapf from dependencies - Add .git-blame-ignore-revs for formatting commit
Apply ruff formatting to entire codebase. This is a one-time formatting change to adopt modern Python formatting standards. Main changes: - Consistent double quotes for strings - Trailing commas in multi-line function parameters - Standardized spacing and line breaks - Removed trailing whitespace No functional changes - formatting only.
- Auto-fixed 13 issues with --unsafe-fixes: - Import reordering for better organization - Modernized isinstance() calls to use | operator - Converted .format() to f-strings - Simplified path comparisons - Converted generator to dict comprehension - Removed trailing whitespace - Updated type hints from typing module to built-in types - Manual fixes: - Added noqa comments for exception chaining (B904) where existing pattern is intentional - Implemented __hash__ method for Sentinel class to properly support equality comparison
- Remove pylint from CI workflow and setup.py - Delete .pylintrc configuration file - Remove yapf configuration from pyproject.toml - Update CONTRIBUTING.md to use ruff commands - Update VS Code settings to use ruff formatter and linter - Fix missing imports that were removed during ruff import reorganization: - Restore Timezone export in scheduler_fn.py - Restore AlertType export in alerts_fn.py - Format remaining files with ruff formatter
- Add clear comments explaining why Timezone and AlertType are re-exported - Add noqa: F401 to suppress unused import warnings for intentional re-exports - Fix import ordering to satisfy ruff
- Mypy doesn't understand dynamic attributes on Callable types - Add type: ignore comment to suppress the error - This is a common pattern for decorators that add attributes
/gemini review |
/gemini review |
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.
Code Review
This is an excellent pull request that successfully migrates the project from pylint
and yapf
to ruff
. The changes are comprehensive, covering not only the code formatting and linting fixes but also updating the configuration, developer documentation, and editor settings. The addition of .git-blame-ignore-revs
is a thoughtful touch that will maintain the quality of the git history.
The new ruff
configuration in pyproject.toml
is well-structured and the selected rules and ignores are sensible for a project of this nature. The automated code changes, such as modernizing type hints and using f-strings, are great improvements.
I've reviewed all the changes carefully and found no issues of medium or higher severity. The migration appears to be executed flawlessly. Great work!
Summary
Changes
1. Added ruff configuration in
pyproject.toml
2. Updated CI workflows
3. Applied ruff formatting and linting fixes
4. Removed legacy tools
5. Fixed import issues
6. Added .git-blame-ignore-revs