Repository navigation
replace black with ruff format and update ruff to 0.17.0 - #65
Merged
Merged
Conversation
ruff format is a drop-in replacement for black, so black is no longer needed. ruff 0.1.0 and black 23.10.0 were both from October 2023: - move the lint settings to [tool.ruff.lint], the top-level ones are deprecated - replace --show-source, which newer ruff versions removed, with --output-format=full - use black's line length of 100, and only format rolo/ and tests/ as black did (ruff also formats code blocks in Markdown files) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The dev tools were pinned to black 23.10.0 and ruff 0.1.0, both from October 2023.
ruff formatis a drop-in replacement for black, so we don't need black in addition to ruff. With the current code, the latest black (26.10.1) andruff format0.17.0 reformat the same 12 files, and their output differs in a singleassertstatement.Changes
ruff format/ruff format --checkinmake formatandmake lint.ruff==0.17.0(formatters change their style between versions, so they stay pinned).select/ignoreto[tool.ruff.lint], since the top-level settings are deprecated.--show-source, which newer ruff versions removed, with--output-format=full.rolo/andtests/, like black'sincludedid. ruff 0.17 would also formatdocs/,examples/, and the Python code blocks in Markdown files.The formatting itself is in #66, the PR below this one in the stack, so it lands as its own commit on
main. This PR only adds the 3 dummy implementations collapsed to one line (def f(): ...), which black 23 didn't accept.Testing
make lintpasses with ruff 0.17.0, with no lint findings under the existing rule set.🤖 Generated with Claude Code