Enforce cargo fmt across the codebase (single reformat + CI gate) #35

Open
opened 2026-06-14 14:47:18 +01:00 by claude-clouddev1 · 0 comments
Collaborator

Summary

The codebase is not cargo fmt-clean. Running cargo fmt --check
on main reports ~1800 diff hunks spread across files that no
recent change has touched (e.g. src/app.rs), so this is a
long-standing baseline drift, not the product of any single session.

This surfaced again during the ADR-0052 vestigial-source unwind
(commit e8fa859): the refactor touched ~164 call sites, but
cargo fmt could not be used to normalise them, because it would have
reformatted the entire codebase and buried the real change under a
massive unrelated diff. The edits were hand-matched to surrounding
style instead. It has reportedly also come up on the CI branch.

Why now / why not yet

We want this done once, deliberately, not piecemeal:

  • It should land as a single dedicated "cargo fmt + enforce" commit
    so the formatting churn is isolated and reviewable on its own.
  • It needs to be coordinated with the CI work (mostly sorted on a
    separate branch) so the same rustfmt.toml / format-gate is applied
    consistently and CI enforces it going forward.
  • Doing it before the branches merge would create gigantic, painful
    merge conflicts (a full-tree reformat vs. in-flight feature diffs).

Target: after the outstanding branches (incl. CI) are merged, and
before the first "real" publication.

Scope / acceptance criteria

  • Decide on rustfmt.toml settings (or accept rustfmt defaults) —
    confirm with the maintainer before bulk-applying.
  • Run cargo fmt once across the whole tree in a single isolated
    commit (no functional changes mixed in).
  • cargo fmt --check is clean on main.
  • CI enforces cargo fmt --check (couples with the CI/TT5 work).
  • Full suite still green after the reformat (cargo test,
    cargo clippy --all-targets).

Notes

  • Pure formatting; no behaviour change expected.
  • Blocked-until (not blocked-on-work): coordinate ordering with the CI
    branch merge.
## Summary The codebase is **not** `cargo fmt`-clean. Running `cargo fmt --check` on `main` reports **~1800 diff hunks** spread across files that no recent change has touched (e.g. `src/app.rs`), so this is a long-standing baseline drift, not the product of any single session. This surfaced again during the ADR-0052 vestigial-`source` unwind (commit `e8fa859`): the refactor touched ~164 call sites, but `cargo fmt` could not be used to normalise them, because it would have reformatted the entire codebase and buried the real change under a massive unrelated diff. The edits were hand-matched to surrounding style instead. It has reportedly also come up on the CI branch. ## Why now / why not yet We want this done **once, deliberately**, not piecemeal: - It should land as a **single dedicated "cargo fmt + enforce" commit** so the formatting churn is isolated and reviewable on its own. - It needs to be coordinated with the **CI work** (mostly sorted on a separate branch) so the same `rustfmt.toml` / format-gate is applied consistently and CI enforces it going forward. - Doing it before the branches merge would create gigantic, painful merge conflicts (a full-tree reformat vs. in-flight feature diffs). **Target: after the outstanding branches (incl. CI) are merged, and before the first "real" publication.** ## Scope / acceptance criteria - [ ] Decide on `rustfmt.toml` settings (or accept rustfmt defaults) — confirm with the maintainer before bulk-applying. - [ ] Run `cargo fmt` once across the whole tree in a single isolated commit (no functional changes mixed in). - [ ] `cargo fmt --check` is clean on `main`. - [ ] CI enforces `cargo fmt --check` (couples with the CI/TT5 work). - [ ] Full suite still green after the reformat (`cargo test`, `cargo clippy --all-targets`). ## Notes - Pure formatting; **no behaviour change** expected. - Blocked-until (not blocked-on-work): coordinate ordering with the CI branch merge.
claude-clouddev1 added the enhancement label 2026-06-14 14:47:18 +01:00
Sign in to join this conversation.