Modernize tooling: replace black with ruff format#2
Conversation
Replace black with ruff format across pyproject.toml, justfile, CI, and README. Bump minimum Python to 3.12. Set line-length to 120. Add ruff format --check step to CI workflow.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces Black with Ruff’s formatter, raises the minimum supported Python version to 3.12 across tooling, and updates local/CI commands and documentation to match the new formatting and version policy. Flow diagram for updated just commands and toolingflowchart TD
Dev[Developer] -->|runs| Justfile[just commands]
subgraph Env[Python environment]
MinPy[Python >= 3.12]
uv[uv]
ruff[ruff]
mypy[mypy]
end
Justfile -->|just lint| LintCmd[uv run ruff check .]
Justfile -->|just format| FormatCmd[uv run ruff format .]
Justfile -->|just typecheck| TypeCmd[uv run mypy src]
Justfile -->|just check| CheckCmd[lint + typecheck + test]
LintCmd --> uv
FormatCmd --> uv
TypeCmd --> uv
uv --> ruff
uv --> mypy
Dev -->|reads| README[README tooling docs]
README -->|mentions| RuffFmt[ruff used for linting and formatting]
README -->|mentions| PyPolicy[Python 3.12+ compatibility]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the project's development environment by consolidating linting and formatting under Ruff, eliminating the need for Black. It also aligns the project with a more recent Python version, ensuring compatibility with modern language features and libraries. These changes aim to simplify the tooling setup and improve code consistency. Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider updating the
just checktarget to include the newruff format --checkstep so that the aggregate localcheckcommand more closely mirrors what CI enforces.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider updating the `just check` target to include the new `ruff format --check` step so that the aggregate local `check` command more closely mirrors what CI enforces.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request modernizes the project's tooling by replacing black with ruff for formatting and updating the minimum Python version to 3.12. The changes in pyproject.toml, justfile, and README.md are consistent with these goals. However, the pull request description and test plan both mention significant changes to the CI workflow, such as adding a ruff format --check step and updating the Python version matrix. The CI workflow file containing these changes appears to be missing from this pull request. Please include it to ensure the CI pipeline is updated as intended and can properly validate the new project standards.
There was a problem hiding this comment.
Pull request overview
Updates the project template’s Python/tooling configuration to standardize on Ruff for both linting and formatting, while raising the supported Python baseline.
Changes:
- Replace Black with
ruff formatin developer commands and configuration. - Raise minimum supported Python to 3.12 and update CI to test newer Python versions.
- Add a dedicated
ruff format --checkstep in CI and adjust formatting settings (line length, quote style).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
pyproject.toml |
Bumps requires-python, removes Black from dev deps, configures Ruff formatting and updated line length, updates mypy target version. |
justfile |
Switches just format from Black to ruff format. |
README.md |
Updates documented tooling and Python compatibility to match Ruff + Python 3.12+. |
.github/workflows/ci.yml |
Updates Python matrix and adds ruff format --check in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [tool.ruff] | ||
| line-length = 88 | ||
| line-length = 120 | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["E", "F", "W", "I"] | ||
|
|
||
| [tool.black] | ||
| line-length = 88 | ||
| target-version = ["py310"] | ||
| [tool.ruff.format] | ||
| quote-style = "double" |
| - **ruff** for linting and formatting, **mypy** for type checking | ||
| - **hatchling** build backend | ||
| - Python 3.10+ compatibility | ||
| - Python 3.12+ compatibility | ||
|
|
| - name: Lint | ||
| run: uv run ruff check . | ||
|
|
||
| - name: Format check | ||
| run: uv run ruff format --check . |
|
|
||
| [dependency-groups] | ||
| dev = ["pytest", "ruff", "black", "mypy"] | ||
| dev = ["pytest", "ruff", "mypy"] |
Update .python-version from 3.10 to 3.12 to match requires-python. Fix ruff I001 import ordering in tests/conftest.py.
Add ruff target-version = py312 to align lint rules with requires-python. Add format-check target to justfile so local `just check` mirrors CI. Use uv sync --frozen in CI to catch lockfile drift. Regenerate uv.lock to remove black.
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on f5a0e89..f9e5fdf
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (4)
• .github/workflows/ci.yml
• README.md
• justfile
• pyproject.toml
Summary
ruff format --checkstep to CI workflow[tool.black]section, add[tool.ruff.format]with double-quote styleTest plan
just formatruns ruff format (not black)uv syncresolves without black in dev dependenciesSummary by Sourcery
Modernize Python tooling by adopting ruff as the formatter, increasing the supported Python version, and aligning configs, CI, and docs with the new setup.
New Features:
ruff format --checkfor formatting validation.Enhancements:
Build:
CI:
High-level PR Summary
This PR modernizes the project's tooling by replacing
blackwithruff formatfor code formatting and bumps the minimum Python version from 3.10 to 3.12. The changes update all configuration files, CI workflows, and documentation to reflect the new formatting tool, increase the line length from 88 to 120 characters, and add a format check step to the CI pipeline. Theblackdependency is removed from dev dependencies and replaced withruff formatconfiguration.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
pyproject.tomljustfile.github/workflows/ci.ymlREADME.md