-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrustfmt.toml
More file actions
55 lines (45 loc) · 1.28 KB
/
rustfmt.toml
File metadata and controls
55 lines (45 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
max_width = 108
comment_width = 108
# Match LF line endings
newline_style = "Unix"
# General indentation / layout
hard_tabs = false
tab_spaces = 4
indent_style = "Block"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
# Keep code reasonably dense but readable
use_small_heuristics = "Max"
fn_single_line = false
where_single_line = false
# Imports: keep them ordered and grouped
imports_granularity = "Module"
group_imports = "StdExternalCrate"
reorder_imports = true
reorder_modules = true
# Comments and doc comments (similar to docstring formatting)
wrap_comments = true
format_code_in_doc_comments = true
normalize_comments = true
normalize_doc_attributes = true
# Strings and macros
format_strings = false
format_macro_matchers = false
format_macro_bodies = true
# Trailing punctuation and spacing
trailing_comma = "Vertical"
match_block_trailing_comma = false
type_punctuation_density = "Wide"
space_before_colon = false
space_after_colon = true
spaces_around_ranges = false
binop_separator = "Front"
# Blank lines
blank_lines_upper_bound = 1
blank_lines_lower_bound = 0
# Edition / style version (adjust if you target 2018/2021)
edition = "2021"
style_edition = "2024"
# A bit stricter about keeping things formatted
error_on_unformatted = true
error_on_line_overflow = false