Skip to content

chore(backend): ruff lint ratchet + CI gate; dedupe email-validator (#193, #194)#223

Merged
Jose-Gael-Cruz-Lopez merged 1 commit into
mainfrom
chore/193-194-ruff-ratchet
Jun 14, 2026
Merged

chore(backend): ruff lint ratchet + CI gate; dedupe email-validator (#193, #194)#223
Jose-Gael-Cruz-Lopez merged 1 commit into
mainfrom
chore/193-194-ruff-ratchet

Conversation

@Jose-Gael-Cruz-Lopez

Copy link
Copy Markdown
Member

Closes #193, closes #194.

#193 — backend linter ratchet

The backend had no linter/formatter (CLAUDE.md admitted it with a # TODO). Adds ruff as a true ratchet, mirroring the frontend ESLint baseline (#212):

  • backend/ruff.toml enforces ruff's default correctness set — E4 (import placement), E7 (statement errors), E9 (syntax), F (pyflakes: unused imports/vars, undefined names).
  • The 94 pre-existing violations (37 files) are baselined in [lint.per-file-ignores], so ruff check . is green today.
  • A new violation — in a new file, or a new rule category in an existing baselined file — fails CI. Verified both: a new file with an unused import fails, and an injected F821 in the E402-only-baselined main.py fails. The baseline can only shrink.
  • Wired into the CI backend job (ruff check .), and ruff added to requirements.txt. CLAUDE.md lint TODO updated.

Formatting deliberately not gated: ruff format would require a one-shot reformat of the whole backend that would collide with every in-flight PR. Per the brief, I kept it check-only / baselined (the conflict-free option) — line-length (E501) and other pure-style rules stay the formatter's job, run manually for now. This means there's no source-file diff in this PR (only ruff.toml, requirements.txt, ci.yml, CLAUDE.md), so it does not collide with the in-flight security PRs.

Most baseline entries are F401/F841 (dead imports/vars) — safe for a future PR to burn down.

#194 — folded in

email-validator was listed twice (runtime dep + under # Testing). Removed the duplicate; it appears once.

⚠️ Per Wave-1 convention: do not merge — opened for review.

…or (#193, #194)

#193: backend had no linter. Add ruff with the default correctness rule set
(E4/E7/E9/F), gated in CI (ruff check .). Mirrors the frontend ESLint ratchet
(#212): the 94 pre-existing violations are baselined in ruff.toml
per-file-ignores, so the check is green today and any NEW violation — a new
file, or a new rule category in an existing file — fails CI. The baseline can
only shrink.

Formatting (ruff format) is intentionally left un-gated: enabling it would
require a one-shot reformat of the whole backend that would collide with every
in-flight PR. Line-length / style stays the formatter's job, run manually for
now. Updated the CLAUDE.md lint TODO accordingly.

#194: email-validator was listed twice (runtime dep + under # Testing). Removed
the duplicate; it now appears once.
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Jose-Gael-Cruz-Lopez, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 14 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a4e95321-0b9c-491e-b769-2480373cd92d

📥 Commits

Reviewing files that changed from the base of the PR and between a27b688 and 0f630d2.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • CLAUDE.md
  • backend/requirements.txt
  • backend/ruff.toml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/193-194-ruff-ratchet

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
frontend 0f630d2 Commit Preview URL

Branch Preview URL
Jun 13 2026, 04:01 AM

@Jose-Gael-Cruz-Lopez Jose-Gael-Cruz-Lopez merged commit 5d8dc8c into main Jun 14, 2026
6 checks passed
@Jose-Gael-Cruz-Lopez Jose-Gael-Cruz-Lopez deleted the chore/193-194-ruff-ratchet branch June 14, 2026 02:17
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.

email-validator is listed twice in backend/requirements.txt Backend has no linter/formatter (no ruff/flake8/black)

1 participant