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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# --------------------------------------------------------------------------------------------------
# Sourced from a combination of
# 1. rustfmt --print-config=default > rustfmt.toml
# 2. rustfmt --help=config
# 3. https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=
# --------------------------------------------------------------------------------------------------
= "1.4.38"
# Maximum width of an array literal before falling back to vertical formatting.
# Default: 60
# Possible values: any positive integer that is less than or equal to the value specified for max_width
= 80
# Maximum width of the args of a function-like attributes before falling back to vertical formatting.
# Default value: 70
# Possible values: any positive integer that is less than or equal to the value specified for max_width
= 100
# Where to put a binary operator when a binary expression goes multiline.
# Default value: "Front"
# Possible values: "Front", "Back"
= "Front"
# Minimum number of blank lines which must be put between items. If two items have fewer blank lines
# between them, additional blank lines are inserted.
# Default value: 0
# Possible values: unsigned integer
= 0
# Maximum number of blank lines which can be put between items. If more than this number of consecutive
# empty lines are found, they are trimmed down to match this integer.
# Default value: 1
# Possible values: any non-negative integer
= 1
# Brace style for items
# Default value: "SameLineWhere"
# Possible values: "AlwaysNextLine", "PreferSameLine", "SameLineWhere"
= "AlwaysNextLine"
# Maximum length of a chain to fit on a single line.
# Default: 60
# Possible values: any positive integer that is less than or equal to the value specified for max_width
= 110
# Whether to use colored output or not.
# Default value: "Auto"
# Possible values: "Auto", "Always", "Never"
= "Auto"
# Combine control expressions with function calls.
# Default value: true
# Possible values: true, false
= true
# Maximum length of comments. No effect unless wrap_comments = true.
# Default value: 80
# Possible values: any positive integer
= 100
# Replace strings of _ wildcards by a single .. in tuple patterns
# Default value: false
# Possible values: true, false
= false
# Brace style for control flow constructs
# Default value: "AlwaysSameLine"
# Possible values: "AlwaysNextLine", "AlwaysSameLine", "ClosingNextLine"
= "AlwaysSameLine"
# Don't reformat anything
# Default value: false
# Possible values: true, false
= false
# Specifies which edition is used by the parser.
# Default value: "2015"
# Possible values: "2015", "2018", "2021"
= "2021"
# Put empty-body functions and impls on a single line
# Default value: true
# Possible values: true, false
= true
# The maximum length of enum variant having discriminant, that gets vertically aligned with others.
# Variants without discriminants would be ignored for the purpose of alignment.
# Note that this is not how much whitespace is inserted, but instead the longest variant name that
# doesn't get ignored when aligning.
# Default value : 0
# Possible values: any positive integer
= 0
# Error if Rustfmt is unable to get all lines within max_width, except for comments and string
# literals. If this happens, then it is a bug in Rustfmt. You might be able to work around the bug
# by refactoring your code to avoid long/complex expressions, usually by extracting a local variable
# or using a shorter name.
# Default value: false
# Possible values: true, false
= false
# Error if unable to get comments or string literals within max_width, or they are left with trailing whitespaces.
# Default value: false
# Possible values: true, false
= false
# Control the layout of arguments in a function
# Default value: "Tall"
# Possible values: "Compressed", "Tall", "Vertical"
= "Compressed"
# Maximum width of the args of a function call before falling back to vertical formatting.
# Default value: 60
# Possible values: any positive integer that is less than or equal to the value specified for max_width
= 110
# Put single-expression functions on a single line
# Default value: false
# Possible values: true, false
= false
# Always print the abi for extern items
# Default value: true
# Possible values: true, false
= true
# Force multiline closure and match arm bodies to be wrapped in a block
# Default value: false
# Possible values: false, true
= false
# Format code snippet included in doc comments.
# Default value: false
# Possible values: true, false
= false
# Format generated files. A file is considered generated if any of the first five lines contains @generated marker.
# Default value: false
# Possible values: true, false
= false
# Format the metavariable matching patterns in macros.
# Default value: false
# Possible values: true, false
= false
# Format the bodies of macros.
# Default value: true
# Possible values: true, false
= true
# Format string literals where necessary
# Default value: false
# Possible values: true, false
= false
# Controls the strategy for how imports are grouped together.
# Default value: Preserve
# Possible values: Preserve, StdExternalCrate
= "StdExternalCrate"
# Use tab characters for indentation, spaces for alignment
# Default value: false
# Possible values: true, false
= false
# Control the case of the letters in hexadecimal literal values
# Default value: Preserve
# Possible values: Upper, Lower
= "Preserve"
# Do not show parse errors if the parser failed to parse files.
# Default value: false
# Possible values: true, false
= false
# Skip formatting files and directories that match the specified pattern. The pattern format is the
# same as .gitignore. Be sure to use Unix/forwardslash / style paths. This path style will work on
# all platforms. Windows style paths with backslashes \ are not supported.
# Default value: format every file
# Ignore specific files: ["src/types.rs", "src/foo/bar.rs"]
# Ignore everything in examples: ["examples"]
# Ignore everything below the rustfmt.toml location: ["/"]
= []
# Indent style of imports
# Default Value: "Block"
# Possible values: "Block", "Visual"
= "Block"
# How imports should be grouped into use statements. Imports will be merged or split to the
# configured level of granularity.
# Default value: Preserve
# Possible values: Preserve, Crate, Module, Item, One
= "Preserve"
# Item layout inside a imports block
# Default value: "Mixed"
# Possible values: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
= "Mixed"
# Indent on expressions or items.
# Default value: "Block"
# Possible values: "Block", "Visual"
= "Block"
# Write an item and its attribute on the same line if their combined width is below a threshold
# Default value: 0
# Possible values: any positive integer
= 0
# Check whether beginnings of files match a license template.
# Default value: ""
# Possible values: path to a license template file
= ""
# Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
# Default value: true
# Possible values: true, false
= true
# Controls whether to include a leading pipe on match arms
# Default value: Never
# Possible values: Always, Never, Preserve
= "Never"
# Put a trailing comma after a block based match arm (non-block arms are not affected)
# Default value: false
# Possible values: true, false
= true
# Maximum width of each line
# Default value: 100
# Possible values: any positive integer
= 115
# Merge multiple derives into a single one.
# Default value: true
# Possible values: true, false
= true
# Unix or Windows line endings
# Default value: "Auto"
# Possible values: "Auto", "Native", "Unix", "Windows"
= "Unix"
# Convert /* */ comments to // comments where possible
# Default value: false
# Possible values: true, false
= true
# Convert #![doc] and #[doc] attributes to //! and /// doc comments.
# Default value: false
# Possible values: true, false
= false
# When structs, slices, arrays, and block/array-like macros are used as the last argument
# in an expression list, allow them to overflow (like blocks/closures) instead of being
# indented on a new line.
# Default value: false
# Possible values: true, false
= true
# Remove nested parens.
# Default value: true,
# Possible values: true, false
= true
# Reorder impl items. type and const are put first, then macros and methods.
# Default value: false
# Possible values: true, false
= false
# Reorder import and extern crate statements alphabetically in groups (a group is separated by a newline).
# Default value: true
# Possible values: true, false
= true
# Reorder mod declarations alphabetically in group.
# Default value: true
# Possible values: true, false
= true
# Report FIXME items in comments.
# Default value: "Never"
# Possible values: "Always", "Unnumbered", "Never"
= "Never"
# Report TODO items in comments.
# Default value: "Never"
# Possible values: "Always", "Unnumbered", "Never"
= "Never"
# Don't reformat out of line modules
# Default value: false
# Possible values: true, false
= false
# Leave a space after the colon.
# Default value: true
# Possible values: true, false
= true
# Leave a space before the colon.
# Default value: false
# Possible values: true, false
= false
# Put spaces around the .., ..=, and ... range operators
# Default value: false
# Possible values: true, false
= false
# The maximum diff of width between struct fields to be aligned with each other.
# Default value: 0
# Possible values: any non-negative integer
= 0
# Put small struct literals on a single line
# Default value: true
# Possible values: true, false
= true
= 18
= 35
= 110
# Number of spaces per tab
# Default value: 4
# Possible values: any positive integer
= 4
# How to handle trailing commas for lists
# Default value: "Vertical"
# Possible values: "Always", "Never", "Vertical"
= "Vertical"
# Add trailing semicolon after break, continue and return
# Default value: true
# Possible values: true, false
= true
# Determines if + or = are wrapped in spaces in the punctuation of types
# Default value: "Wide"
# Possible values: "Compressed", "Wide"
= "Compressed"
# Enable unstable features on the unstable channel.
# Default value: false
# Possible values: true, false
= true
# Use field initialize shorthand if possible.
# Default value: false
# Possible values: true, false
= true
# Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'.
# Default value: "Default"
# Possible values: "Default", "Off", "Max"
= "Max"
# Replace uses of the try! macro by the ? shorthand
# Default value: false
# Possible values: true, false
= true
# Which version of the formatting rules to use. Version::One is backwards-compatible with Rustfmt 1.0.
# Other versions are only backwards compatible within a major version number.
# Default value: One
# Possible values: One, Two
= "One"
# Forces the where clause to be laid out on a single line.
# Default value: false
# Possible values: true, false
= true
# Break comments to fit on the line
# Default value: false
# Possible values: true, false
= true