1.5 KiB
1.5 KiB
094 — Adopt rustfmt and format the codebase
Summary
The Rust backend has no rustfmt.toml and isn't currently formatted
to rustfmt's defaults: cargo fmt -- --check exits non-zero, reporting
diffs across 24 files (352 diff hunks total).
Where
- No
rustfmt.toml/.rustfmt.tomlexists at the repo root. cargo fmt -- --checkreports diffs insrc/api/{dto,mcp_server,mod}.rs,src/cli/{mod,sessions}.rs,src/config/{mod,profile}.rs, and most ofsrc/engine/**(alerts.rs,data_value.rs,filter_datetime.rs,filter_parser.rs,ingest.rs,logfmt.rs,message.rs,mod.rs,promql.rs,rate.rs,snapshot/{filter,metrics,mod,params,query,sort}.rs,tests.rs). Heaviest:src/engine/snapshot/mod.rs(~65 hunks),src/config/profile.rs(~38),src/api/mod.rs(~35),src/engine/alerts.rs(~28).Makefile:26(lint-be) currently only runscargo clippy --all-targets— nocargo fmt --checkstep.
Scope
- Add a
rustfmt.tomlif any defaults should be overridden (otherwise an empty/absent file is fine and rustfmt defaults apply — decide whether to keep the file empty for documentation purposes or omit it). - Run
cargo fmtacross the wholesrc/tree as a single, non-functional formatting commit (don't mix with logic changes, to keep the diff reviewable andgit blame-friendly). - Add a
cargo fmt --checkstep tomake lint(or a newmake fmt-checkwired into CI) so future changes can't drift out of format again.