Skip to content

Commit 2dd722b

Browse files
Centrilmark-i-m
authored andcommitted
Please don't rustfmt.
1 parent 06908de commit 2dd722b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/conventions.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,12 @@ you introduce some code following one strategy, then change it
114114
dramatically (versus adding to it) in a later commit, that
115115
'back-and-forth' can be confusing.
116116

117-
**If you run rustfmt and the file was not already formatted, isolate
118-
that into its own commit.** This is really the same as the previous
119-
rule, but it's worth highlighting. It's ok to rustfmt files, but since
120-
we do not currently run rustfmt all the time, that can introduce a lot
121-
of noise into your commit. Please isolate that into its own
122-
commit. This also makes rebases a lot less painful, since rustfmt
123-
tends to cause a lot of merge conflicts, and having those isolated
124-
into their own commit makes them easier to resolve.
117+
**Only run rustfmt on new content.** One day, we might enforce formatting
118+
for the rust-lang/rust repo. Meanwhile, we prefer that rustfmt not be run
119+
on existing code as that will generate large diffs and will make git blame
120+
harder to sift through. However, running `rustfmt` on new content, e.g. a
121+
new file or a largely new part of a file is ok. Small formatting adjustments
122+
nearby code you are already changing for other purposes are also ok.
125123

126124
**No merges.** We do not allow merge commits into our history, other
127125
than those by bors. If you get a merge conflict, rebase instead via a

0 commit comments

Comments
 (0)