style: enforce ruff format across codebase#2874
Open
mvanhorn wants to merge 1 commit intosherlock-project:masterfrom
Open
style: enforce ruff format across codebase#2874mvanhorn wants to merge 1 commit intosherlock-project:masterfrom
mvanhorn wants to merge 1 commit intosherlock-project:masterfrom
Conversation
Add ruff format configuration to pyproject.toml (double quotes, space indent to match .editorconfig) and add format check to the tox lint environment so CI enforces consistent formatting on every PR. The codebase was previously formatted with Black once (PR sherlock-project#1957) but drifted over time. This applies ruff format to all Python files and ensures formatting stays consistent going forward. Use git blame -w to ignore whitespace-only changes. This contribution was developed with AI assistance (Claude Code).
1 task
This comment was marked as spam.
This comment was marked as spam.
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.
Summary
Adds
ruff formatenforcement to the project's lint pipeline and reformats the codebase. The project already usesruff checkfor linting (viatox -e lint). This addsruff format --checkto the same tox environment so formatting is enforced on every PR going forward.Changes
pyproject.toml: Added[tool.ruff.format]section withquote-style = "double"andindent-style = "space"to match the existing.editorconfigconventions.tox.ini: Addedruff format --checkto the[testenv:lint]commands, running afterruff check.ruff formatto 16 files. Changes are whitespace, quote normalization, and line wrapping. No logic changes.Context
The project was formatted with Black once in commit b0ec99e (PR #1957), but formatting drifted over time. Since ruff is already a lint dependency, using its built-in formatter avoids adding Black as a separate tool.
For
git blame, usegit blame -wto skip whitespace-only changes from this PR.Testing
All existing tests pass after formatting.
ruff checkandruff format --checkboth pass.Fixes #2368
This contribution was developed with AI assistance (Claude Code).