Skip to content

Gate lint and formatting in CI - #42

Merged
ShichengRao merged 2 commits into
mainfrom
claude/ruff-ci-gate
Aug 13, 2026
Merged

ShichengRao merged 2 commits into
mainfrom
claude/ruff-ci-gate

Conversation

@ShichengRao

Copy link
Copy Markdown
Owner

Summary

Adds the CI gate that makes #41 stick.

Formatting the tree only helps until the next person edits without running the formatter — and then the one after that reformats everything inside an unrelated change, which is the problem #41 set out to end. A check is what makes it hold.

Stacked on #41. Its base is claude/ruff-format-baseline, so the diff here is just the gate. Merge #41 first; GitHub will retarget this to main automatically. Merging this against an unformatted main would fail CI on the first run, which is the point.

Type of Change

  • Importer support
  • Bug fix
  • Tests
  • Documentation
  • Frontend
  • Backend
  • Refactor / cleanup

Details

A python-lint job runs ruff check and ruff format --check. It is its own job rather than two more steps on the backend one, so a formatting failure reads as a formatting failure instead of "Backend tests failed".

make lint runs exactly what CI runs, and make format is the fixer for what it reports — so the command that fails in CI is the same one available locally, and the fix is one target away rather than a flag someone has to remember.

Both cover scripts/ and api/ alongside the backend. Ruff was only ever pointed at backend/, which is precisely why the script directory carried a lint error nobody had seen until #41.

Privacy Checklist

  • I used only synthetic test/sample data.
  • I did not include real account numbers, balances, merchants, names, addresses, or other personal details.
  • This change does not add or expand outbound network access. CI installs the dev extra that already exists.

Testing

make lint passes on the tree as of #41 (All checks passed!, 64 files already formatted), make test (143 passed), and the workflow YAML parses with the expected four jobs and step list.

A gate is only worth having if it fails, so I checked that too: appending a deliberately misformatted function to a backend file made make lint exit non-zero and name the file, and reverting it returned to clean. Verified in the direction that matters, not just the passing one.

Screenshots

n/a.

Related Issue

Depends on #41.

ShichengRao and others added 2 commits August 13, 2026 04:02
Ruff is configured but has never been run as a formatter, so every file
carries whatever shape it was written in. The cost is not the shape — it
is that anyone who runs `ruff format` while editing one file reformats
two dozen others along with it, and the real change disappears into the
noise. That happened while writing the last few changes here.

Formatting everything once makes the next run a no-op, so a diff stays
about what its author actually did.

Mechanical only. Every file was parsed before and after and compared as
an AST: all 64 are identical, so nothing here can change behavior. One
pre-existing lint error came along — a stray blank line in the script
directory's import block, which had never been linted because ruff was
only ever pointed at the backend.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Formatting the tree only helps until the next person edits without
running the formatter, and then the one after that reformats everything
inside an unrelated change. A check is what makes the previous commit
hold.

CI grows a job running `ruff check` and `ruff format --check`, and the
Makefile grows `lint` (what CI runs) and `format` (the fixer), so the
command that fails in CI is the same one available locally.

Both cover scripts/ and api/ as well as the backend. Ruff was only ever
pointed at backend/, which is exactly why the script directory had a
lint error nobody had seen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Base automatically changed from claude/ruff-format-baseline to main August 13, 2026 15:49
@ShichengRao
ShichengRao merged commit 41f6805 into main Aug 13, 2026
6 checks passed
@ShichengRao
ShichengRao deleted the claude/ruff-ci-gate branch August 13, 2026 15:49
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.

1 participant