-
Notifications
You must be signed in to change notification settings - Fork 35
Replace black with ruff format #536
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
Reviewer's GuideThis PR replaces Black with Ruff as the code formatter and linter across CI and pre-commit, bumps Python versions in workflows, introduces the UV wrapper for tox in the typechecker job, and applies multiline formatting adjustments in source files to satisfy Ruff. Flow diagram for pre-commit hooks with Ruff replacing Blackflowchart TD
PreCommit[pre-commit]
RuffCheck[ruff-check]
RuffFormat[ruff-format]
PreCommitHooks[pre-commit-hooks]
PreCommit --> RuffCheck
PreCommit --> RuffFormat
PreCommit --> PreCommitHooks
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @cgtobi - I've reviewed your changes - here's some feedback:
- Ensure the
pythonpackageandlinterjobs still include a code checkout or confirm thatruff-actionimplicitly checks out the repo and sets up Python, otherwise those steps will fail. - Double-check that the new pre-commit hook IDs (
ruff-checkandruff-format) actually exist in the ruff-pre-commit repo to avoid misconfigured hooks. - The expanded f-string blocks for ENERGY_FILTERS could be simplified by constructing a list of values and using
','.join(...)to reduce repetition and improve maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Ensure the `pythonpackage` and `linter` jobs still include a code checkout or confirm that `ruff-action` implicitly checks out the repo and sets up Python, otherwise those steps will fail.
- Double-check that the new pre-commit hook IDs (`ruff-check` and `ruff-format`) actually exist in the ruff-pre-commit repo to avoid misconfigured hooks.
- The expanded f-string blocks for ENERGY_FILTERS could be simplified by constructing a list of values and using `','.join(...)` to reduce repetition and improve maintainability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Replace Black with Ruff for code formatting and linting across CI and pre-commit hooks, update Python versions in workflows, and apply corresponding code reformatting adjustments.
Enhancements:
CI:
Deployment:
Chores: