refactor: replace Black with Ruff, add pre-commit hooks#143
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (26)
📝 WalkthroughWalkthroughMigrates Python formatting/linting from Black to Ruff, adds pre-commit hooks (Ruff, Prettier), removes several unused imports, normalizes file open calls to implicit read mode, adjusts minor error-handling and string-formatting styles, and removes two deprecated public lookup functions referenced by tests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Replace Black formatter with Ruff (format + lint) — same formatting output, adds linting (pyflakes, pycodestyle, isort, bugbear, simplify) - Add .pre-commit-config.yaml with Ruff + Prettier hooks - Auto-fix 111 lint issues (unused imports, f-strings, import sorting) - Fix 4 SIM117 issues in test_definitions.py (nested with → combined) - Remove unused Flask-FlatPages dependency - Update CI workflow: ruff check + ruff format replaces black --check - Update CLAUDE.md with new commands - Exclude deprecated dirs from linting Scripts still have 64 lint warnings (mostly style) — not blocking.
Scripts have 64 pre-existing lint warnings (notebooks, utilities) that aren't worth fixing. Scope CI to production code only.
b484bd5 to
36581a2
Compare
Summary
.pre-commit-config.yaml) with Ruff + Prettier — catches issues before pushFlask-FlatPagesdependencytest_definitions.pywebapp/andtests/are fully lint-clean;scripts/has 64 remaining warnings (style, non-blocking)What's NOT included (intentional)
vue-tsc --noEmitwith strict mode already catches unused locals/params in CITest plan
uv run ruff check webapp/ tests/— all cleanuv run ruff format --check webapp/ tests/— all cleanpnpm format:check— all cleanpnpm test— 81 passeduv run pytest tests/— 2029 passed, 289 skipped, 4 xfailedpnpm build— builds successfullySetup after merge
Run
pre-commit installonce to activate hooks locally.@coderabbitai review
Summary by CodeRabbit
Bug Fixes
Chores
Documentation