Skip to content

Apply cargo fmt — main's lint job is red - #14

Merged
teceer merged 1 commit into
mainfrom
fix/sim-core-fmt-again
Aug 7, 2026
Merged

teceer merged 1 commit into
mainfrom
fix/sim-core-fmt-again

Conversation

@teceer

@teceer teceer commented Aug 7, 2026

Copy link
Copy Markdown
Owner

main is currently red. simulation core fails on rustfmt:

Diff in services/sim-core/crates/sim/src/lib.rs:1625:
##[error]Process completed with exit code 1

An if/else in the deploy test added by ADR 0011 (7f593a9). Formatting only — the 34 sim tests and clippy are both clean before and after, and I re-ran everything else on main to be sure nothing else has drifted:

Suite Result
cargo test (sim-core) 34 pass
cargo clippy --all-targets -D warnings clean
go test ./... (bank, world-gateway, farm, conformance) pass
mix test (tavern) 32 pass
buf lint clean

Worth fixing properly

This is the third time formatting has landed on main and turned the lint job red — the same thing happened twice around #5, once on code from #3 and once on code from #4.

The pattern is always the same: rustfmt is enforced in CI and run nowhere else, so it is caught after landing rather than before. Two cheap options, neither done here because they are their own decision:

  • a pre-commit hook running cargo fmt on staged Rust
  • a make fmt target alongside the existing make lint, so there is something obvious to run

Right now the only way to find out is to push and wait, which is exactly when it is most annoying.

🤖 Generated with Claude Code

`main` is red: the simulation core's lint job fails on rustfmt, at
crates/sim/src/lib.rs:1625 — an if/else introduced by ADR 0011's
deploy test. Formatting only; the 34 tests and clippy are unaffected.

Third time this has happened (see the fmt commits around #5). The
pattern is always the same: rustfmt is enforced in CI and run nowhere
else, so it is caught after landing rather than before. Worth a
pre-commit hook or a `make fmt` that people actually run.
@teceer
teceer merged commit a50925a into main Aug 7, 2026
7 checks passed
@teceer
teceer deleted the fix/sim-core-fmt-again branch August 7, 2026 12:19
teceer added a commit that referenced this pull request Aug 7, 2026
#15)

Formatting has landed on main and turned the lint job red three times now
(twice around #5, again in #14). The pattern never changes: rustfmt is
enforced in CI and run nowhere else, so it is found after landing, by
whoever pushes next.

`make hooks` points core.hooksPath at .githooks/, so the hooks are
versioned and change with the repo rather than being copied into .git once
and forgotten.

The hook checks formatting and nothing else. `make lint` runs clippy,
golangci-lint and credo across nine services; a hook people wait thirty
seconds for is a hook people pass --no-verify to, and then it protects
nothing. Each language is checked only when a file of that language is
staged, because the two slow starts are the BEAM and cargo and neither
should be paid for a change that did not touch them.

`make fmt` is the other half: whatever the hook rejects, it fixes.

Two deliberate omissions:

- No `buf format`. It reflows .proto comments onto a single space before
  the slashes, which destroys the column alignment several of those files
  use to keep a field's meaning readable next to its number. That is the
  author's style choice and a hook is the wrong place to overrule it —
  `make proto-lint` already covers the checks that catch real mistakes.
- No `mix format` for a service without a .formatter.exs, since broadcast
  is still an empty shell (ADR 0010).

Also fixes what gofmt immediately found: a stray blank line in driver.go,
from #10. golangci-lint does not have gofmt enabled here, so CI never saw
it.
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