Skip to content

Commit 1e42de6

Browse files
committed
Adds rustfmt configs to wrap and limit comment width (#1603)
Aims to close #1594. These options are unstable and depend on the following PR's: [wrap_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#wrap_comments): rust-lang/rustfmt#3347 [comment_width](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#comment_width): rust-lang/rustfmt#3349 [normalize_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#normalize_comments): rust-lang/rustfmt#3350 @alice-i-cecile do you think this will solve the issue? When enabled, running the formatter locally should take the configurations into account to format comments. `--check` runs should also be considering them. This should be testable on the `nightly` toolchain. ~I didn't delve into normalizing `//` vs `/* */` though, should I take a look into that too? [normalize_comments](https://rust-lang.github.io/rustfmt/?version=v1.4.36&search=#normalize_comments) seems to be the solution for that but it's also unstable (tracking issue: rust-lang/rustfmt#3350). I can also add this configuration (commented out, of course) if it's desirable.~ Added `normalize_comments` option.
1 parent e9a501e commit 1e42de6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rustfmt.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ newline_style = "Unix"
66
#unstable_features = true
77
#imports_granularity = "Crate"
88
#reorder_impl_items = true
9+
#wrap_comments = true
10+
#comment_width = 100
11+
#normalize_comments = true

0 commit comments

Comments
 (0)