Skip to content

Commit 8b0b0e2

Browse files
committed
Update rustfmt.toml to support nightly flags
In LDK Node we found a `rustfmt.toml` that enables a few nice `nightly` features (such as automatic import grouping) while being backwards compatible with `rustfmt` stable. That means that in day-to-day we can continue to just do `cargo fmt`, but then have a simple weekly `rustfmt` job that cleans up the codebase a bit more.
1 parent ebef52e commit 8b0b0e2

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

rustfmt.toml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ hard_tabs = true
44
use_field_init_shorthand = true
55
max_width = 100
66
match_block_trailing_comma = true
7-
# UNSTABLE: format_code_in_doc_comments = true
8-
# UNSTABLE: overflow_delimited_expr = true
9-
# UNSTABLE: comment_width = 100
10-
# UNSTABLE: format_macro_matchers = true
11-
# UNSTABLE: format_strings = true
12-
# UNSTABLE: group_imports = "StdExternalCrate"
7+
format_code_in_doc_comments = true
8+
comment_width = 100
9+
format_macro_matchers = true
10+
group_imports = "StdExternalCrate"
11+
reorder_imports = true
12+
imports_granularity = "Module"
13+
normalize_comments = true
14+
normalize_doc_attributes = true
15+
style_edition = "2021"
16+
# TBD: do we want comment and string wrapping?
17+
#wrap_comments = true
18+
#format_strings = true
19+
#overflow_delimited_expr = true

0 commit comments

Comments
 (0)