From 4ae7ef03ffcdc4a87033f8432ffc10c4ae46d365 Mon Sep 17 00:00:00 2001 From: Ansho Rei Date: Sun, 23 Aug 2026 00:23:22 +0200 Subject: [PATCH] Let git blame look through the reformat `.git-blame-ignore-revs` names 73ffcad, which touched 22 files and decided nothing, so `git blame` no longer answers "who wrote this line" with the formatter. Opt in per clone: git config blame.ignoreRevsFile .git-blame-ignore-revs Also records the one thing the fmt rule does not cover: sixteen lines still run past 100 columns and all sixteen are single string literals rustfmt cannot break. `format_strings` stays off, since a message is prose and not the formatter's to rewrite. Co-Authored-By: Claude Opus 5 (1M context) --- .git-blame-ignore-revs | 8 ++++++++ AGENTS.md | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..496381f --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,8 @@ +# Revisions that changed layout and nothing else. Teach git to look through them: +# +# git config blame.ignoreRevsFile .git-blame-ignore-revs +# +# Only a commit whose diff is pure formatting belongs here. + +# Reformat with cargo fmt, and nothing else +73ffcad73314621e299dc06ee688db9b4c4d6b29 diff --git a/AGENTS.md b/AGENTS.md index db8fcc4..03b89fc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,6 +54,8 @@ and this file is for what someone changing worklane's own code needs. **The numbers were measured, not chosen.** Default rustfmt wanted 305 hunks and would have added 1418 lines of pure layout, because its sub-widths sit far below the 100 columns this tree is written to. `use_small_heuristics = "Max"` went the other way, 308 hunks and 796 lines *removed*, one-lining `if`/`else` and collapsing struct literals that were split on purpose. Coordinate descent over the stable width knobs landed here, at 161 hunks, and 98 of those are rustfmt *joining* calls that fit rather than breaking them. Sweeping any one of these four in either direction makes the diff bigger, so do not adjust one by eye; measure it the same way, with `cargo fmt --check | grep -c '^Diff in'` - What this does not buy: rustfmt has no rule for "keep parallel arms parallel", so a match whose arms are one line and four lines depending on the length of their contents is what it produces, and that is accepted. Reach for `#[rustfmt::skip]` only where the layout carries meaning a reader needs, not to win an argument about density - Do not add an unstable option. `cargo fmt` on stable ignores them with a warning, so the tree would format differently for whoever ran nightly + - **Sixteen lines still run past 100 columns and every one of them is a single string literal**, a test fixture or an error message rustfmt cannot break. `format_strings` is deliberately left at its default: turning it on would let the formatter rewrite message text, and a message is prose. So `max_width` is where rustfmt breaks lines, not a limit the tree keeps + - The reformat is `73ffcad`, and `.git-blame-ignore-revs` names it so `git blame` looks through it. Turn that on once per clone with `git config blame.ignoreRevsFile .git-blame-ignore-revs`. A commit belongs in that file only if its diff is pure layout ## Coding Guidelines