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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# rustfmt.toml — full configuration with defaults
# Generated from: rust-lang/rustfmt Configurations.md
#
# Unstable options require a nightly toolchain AND `unstable_features = true`.
# Options marked [DEPRECATED] are still accepted but superseded; prefer their
# replacement. Possible values are listed inline for every enum option.
# ─────────────────────────────────────────────────────────────────────────────
# ═══════════════════════════════════════════════════════════════════════════
# STABLE
# ═══════════════════════════════════════════════════════════════════════════
# ── Width heuristics ──────────────────────────────────────────────────────
# All of the *_width options below are overridden by `use_small_heuristics`
# when it is set to "Default" or "Max". Set them here to fix their values
# regardless of `max_width`.
# Possible values: "Default", "Off", "Max"
= "Default"
= 100
= 60 # 60% of max_width (Default)
= 70 # 70% of max_width (Default)
= 60 # 60% of max_width (Default)
= 60 # 60% of max_width (Default)
= 50 # 50% of max_width (Default)
= 50 # 50% of max_width (Default)
= 18 # 18% of max_width (Default)
= 35 # 35% of max_width (Default)
= 10
# ── Indentation ───────────────────────────────────────────────────────────
= false
= 4
# ── Line endings ──────────────────────────────────────────────────────────
# Possible values: "Auto", "Native", "Unix", "Windows"
= "Auto"
# ── Edition / style ───────────────────────────────────────────────────────
# Determines the parser edition. `cargo fmt` reads this from Cargo.toml
# automatically; set explicitly when running `rustfmt` directly.
# Possible values: "2015", "2018", "2021", "2024"
= "2024" # def = "2015"
# ── Function / parameter layout ───────────────────────────────────────────
# Possible values: "Compressed", "Tall", "Vertical"
= "Tall"
# [DEPRECATED] fn_args_layout renamed to fn_params_layout.
# ── Imports ───────────────────────────────────────────────────────────────
= true
= true
# ── Misc formatting ───────────────────────────────────────────────────────
= false
= true
= "Never" # Possible: "Always", "Never", "Preserve"
= false
= true
= true
= false
= false
# ═══════════════════════════════════════════════════════════════════════════
# UNSTABLE (requires nightly + unstable_features = true)
# ═══════════════════════════════════════════════════════════════════════════
# ┌─ IMPORTANT ──────────────────────────────────────────────────────────┐
# │ This gate must be `true` for any option in this section to take │
# │ effect. Set it to `false` to silently ignore all unstable options. │
# └──────────────────────────────────────────────────────────────────────┘
= false # <--- IMPORTANT
# ── Style edition (unstable variant) ─────────────────────────────────────
# Controls which edition of the Rust Style Guide is applied.
# Inferred from `edition` if not set. Prefer this over the deprecated
# `version` key below.
# Possible values: "2015", "2018", "2021", "2024" (2024 is unstable)
= "2024" # def = "2015"
# ── Binary operator placement ─────────────────────────────────────────────
# Possible values: "Front", "Back"
= "Front"
# ── Blank lines ───────────────────────────────────────────────────────────
= 0
= 1
# ── Brace style ───────────────────────────────────────────────────────────
# Possible values: "AlwaysNextLine", "PreferSameLine", "SameLineWhere"
= "SameLineWhere"
# Possible values: "AlwaysNextLine", "AlwaysSameLine", "ClosingNextLine"
= "AlwaysSameLine"
# ── Color output ──────────────────────────────────────────────────────────
# Possible values: "Auto", "Always", "Never"
= "Auto"
# ── Comments ──────────────────────────────────────────────────────────────
= false
= 80 # Only active when wrap_comments = true
= false
= false
# ── Control flow ──────────────────────────────────────────────────────────
= true
= false
# ── Doc comments / code blocks ────────────────────────────────────────────
= false # Consider changing
= 100 # Only active when format_code_in_doc_comments = true
# ── Empty items ───────────────────────────────────────────────────────────
= true
# ── Enum discriminants ────────────────────────────────────────────────────
= 0
# ── Error handling ────────────────────────────────────────────────────────
= false
= false
= true
# [DEPRECATED] Renamed to show_parse_errors (inverted polarity).
# hide_parse_errors = false
# ── File / generation control ─────────────────────────────────────────────
= true
= 5
= false
# ignore = [] # gitignore-style patterns
# ── Floats and hex ────────────────────────────────────────────────────────
# Possible values: "Preserve", "Upper", "Lower"
= "Preserve"
# float_literal_trailing_zero removed (not in stable rustfmt)
# ── Functions ─────────────────────────────────────────────────────────────
= false
= false
# ── Imports ───────────────────────────────────────────────────────────────
# Possible values: "Block", "Visual"
= "Block"
# Possible values: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
= "Mixed"
# Possible values: "Preserve", "Crate", "Module", "Item", "One"
= "Preserve"
# Possible values: "Preserve", "StdExternalCrate", "One"
= "Preserve"
# [DEPRECATED] merge_imports replaced by imports_granularity.
# ── Indentation style ─────────────────────────────────────────────────────
# Possible values: "Block", "Visual"
= "Block"
# ── Inline attributes ─────────────────────────────────────────────────────
= 0
# ── Macros ────────────────────────────────────────────────────────────────
= false
= true
= false
= []
# ── Match arms ────────────────────────────────────────────────────────────
= true
# match_arm_indent removed (not in stable rustfmt)
# ── Ordering ──────────────────────────────────────────────────────────────
= false
# ── Required version ──────────────────────────────────────────────────────
# Uncomment to pin the exact rustfmt version used in CI.
# Possible values: semver strings, e.g. ">=1.0.0", "^2.0.0", "*"
# required_version = CARGO_PKG_VERSION
# ── Spacing ───────────────────────────────────────────────────────────────
= true
= false
= false
# ── Struct formatting ─────────────────────────────────────────────────────
= 0
= true
# ── Trailing tokens ───────────────────────────────────────────────────────
# Possible values: "Always", "Never", "Vertical"
= "Vertical"
= true
# ── Type punctuation ──────────────────────────────────────────────────────
# Possible values: "Compressed", "Wide"
= "Wide"
# ── Where clause ──────────────────────────────────────────────────────────
= false
# ── Version (deprecated) ──────────────────────────────────────────────────
# [DEPRECATED] Replaced by style_edition.
# version = "One" ≡ style_edition = "2015" / "2018" / "2021"
# version = "Two" ≡ style_edition = "2024"
# Possible values: "One", "Two"
# version = "One"