Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Rust is cargo fmt clean, and CI checks it #488

Mergedsyntaqx merged 353-cargo-fmt into main
syntaqxopened this pull request

Formats every Rust file in the repository once, and keeps it that way.

  • rustfmt.toml: max_width = 140, use_small_heuristics = "Max". Of the stable settings tried, this one changed the fewest lines: about 46k changed lines, against about 163k at rustfmt's defaults (100 columns: 133k added, 30k removed), 116k at 120 columns and 86k at 140 columns with default heuristics.
  • 8a750bc is formatting only: cargo fmt --all plus cargo fmt in apps/desktop/src-tauri, 560 files. cargo check --all-targets passes for the workspace and the desktop app afterwards. The commit is listed in .git-blame-ignore-revs. Merge it with a merge commit, not a rebase, so the hash stays the same.
  • CI: a new rustfmt job in ci.yml runs cargo fmt --check over the workspace and the desktop app. Nothing compiles, so it takes a few seconds. Like the desktop job, it runs only when a change touches a .rs file, rustfmt.toml, the toolchain or the workflow (ci-affected.mjs --job rustfmt, with a test).
  • CONTRIBUTING.md: run cargo fmt before pushing Rust. After a rebase conflict with the reformat, take your side and run cargo fmt again.

Open branches that touch Rust will conflict with this change. Most conflicts go away after a merge of main and cargo fmt.

Closes #353

syntaqxadded this to the merge queue·
syntaqxmerged this·
syntaqxdeleted the 353-cargo-fmt branch·

All checks have passed

3 passed · on a375d81

Workflows

CI / pull_request — CI passedDetails
Dependency review — No dependency changesDetails
Preview / pull_request — Preview passedDetails

353-cargo-fmt was deleted

It can be made again at a375d81, where it was.

Sign in to comment.