Enforce code formatting with ruff format
- Dominant language
- Python
- Stars
- 3
- Forks
- 5
- Avg merge
- 1d 23m
- Merged PRs (30d)
- 5
Description
## Summary
Now that [#6](https://github.com/apache/solr-orbit/issues/6) replaces pylint with ruff, the next step is to enforce **consistent code formatting** using \`ruff format\` — ruff's built-in formatter (compatible with Black's style).
## Motivation
- The entire codebase can be formatted in one pass with \`ruff format .\`
- CI already runs \`make lint\`; adding \`ruff format --check .\` there enforces formatting on every PR
- A single tool (ruff) now covers linting *and* formatting — no separate Black/isort dependency needed
- Consistent formatting reduces noise in diffs and eliminates style debates in reviews
## Proposed changes
1. **Format the codebase** — run \`ruff format .\` once to reformat all ~250 Python files
2. **Enable the format check in \`Makefile\`** — uncomment the \`ruff format --check .\` line in the \`lint\` target (the comment-placeholder was left there intentionally)
3. **Document for developers** in \`CONTRIBUTING.md\` or \`DEVELOPER_GUIDE.md\`:
- Run \`ruff format .\` before committing (or configure your editor to do it on save)
- \`make lint\` will fail in CI if files are not formatted
- Optional: recommend a pre-commit hook or IDE integration (VS Code \`ruff\` extension, etc.)
## Notes
- The formatting-only diff will be large (~190 files) but purely mechanical — no logic changes
- It is best submitted as a standalone PR so reviewers can ignore it or review with whitespace-diff disabled (\`?w=1\` in GitHub)
- The \`[tool.ruff.format]\` section can be added to \`pyproject.toml\` at that point (quote style, indent style)
Contributor guide
Assessment
This issue has not been assessed yet.