Skip to content

Commit ca8900c

Browse files
committed
Enforce stricter rustfmt rules to prevent style ambiguity
Changes: - `match_arm_leading_pipes`: "Preserve" -> "Never" (enforce single style) - `trailing_semicolon`: false -> true (enforce `return 42;` with semicolon) - Add `normalize_comments = true` (normalize comment spacing) - Add `normalize_doc_attributes = true` (enforce `///` over `#[doc = ""]`) These changes ensure only one valid formatting style exists, reducing unnecessary diffs in pull requests caused by different but valid styles.
1 parent a6082b3 commit ca8900c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.rustfmt.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ imports_granularity = "Crate"
88
reorder_imports = true
99
# Consistency
1010
newline_style = "Unix"
11+
normalize_comments = true
12+
normalize_doc_attributes = true
1113
# Misc
1214
chain_width = 80
1315
spaces_around_ranges = false
1416
binop_separator = "Back"
1517
reorder_impl_items = false
16-
match_arm_leading_pipes = "Preserve"
18+
match_arm_leading_pipes = "Never"
1719
match_arm_blocks = false
1820
match_block_trailing_comma = true
1921
trailing_comma = "Vertical"
20-
trailing_semicolon = false
22+
trailing_semicolon = true
2123
use_field_init_shorthand = true
2224
# Format comments
2325
comment_width = 100

0 commit comments

Comments
 (0)