Skip to content

style: enforce ruff format across codebase#2874

Open
mvanhorn wants to merge 1 commit intosherlock-project:masterfrom
mvanhorn:feat/2368-ruff-format-enforcement
Open

style: enforce ruff format across codebase#2874
mvanhorn wants to merge 1 commit intosherlock-project:masterfrom
mvanhorn:feat/2368-ruff-format-enforcement

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented Apr 4, 2026

Summary

Adds ruff format enforcement to the project's lint pipeline and reformats the codebase. The project already uses ruff check for linting (via tox -e lint). This adds ruff format --check to the same tox environment so formatting is enforced on every PR going forward.

Changes

  • pyproject.toml: Added [tool.ruff.format] section with quote-style = "double" and indent-style = "space" to match the existing .editorconfig conventions.
  • tox.ini: Added ruff format --check to the [testenv:lint] commands, running after ruff check.
  • All Python files: Applied ruff format to 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, use git blame -w to skip whitespace-only changes from this PR.

Testing

All existing tests pass after formatting. ruff check and ruff format --check both pass.

Fixes #2368

This contribution was developed with AI assistance (Claude Code).

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).
@ruellfranceloso942-source

This comment was marked as spam.

ruellfranceloso942-source

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SUGGESTION] Enforce Consistent Code Formatting

2 participants