-
Notifications
You must be signed in to change notification settings - Fork 0
/
rustfmt.toml
281 lines (212 loc) · 7.65 KB
/
rustfmt.toml
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
# Maximum width of an array literal before falling back to vertical formatting.
# Default: 60
array_width = 100
# Maximum width of the args of a function-like attributes before falling back to vertical formatting.
# Default: 70
attr_fn_like_width = 100
# Where to put a binary operator when a binary expression goes multiline.
# Default: "Front"
binop_separator = "Front"
# Minimum number of blank lines which must be put between items.
# Default: 0
blank_lines_lower_bound = 0
# Maximum number of blank lines which can be put between items.
# Default: 1
blank_lines_upper_bound = 1
# Brace style for items.
# Default: "SameLineWhere"
brace_style = "SameLineWhere"
# Maximum width of a chain to fit on one line.
# Default: 60
chain_width = 100
# Whether to use colored output or not.
# Default: "Auto"
color = "Always"
# Combine control expressions with function calls.
# Default: true
combine_control_expr = true
# Maximum length of comments. No effect unless wrap_comments = true.
# Default: 80
comment_width = 100
# Replace strings of _ wildcards by a single .. in tuple patterns.
# Default: false
condense_wildcard_suffixes = true
# Brace style for control flow constructs.
# Default: "AlwaysSameLine"
control_brace_style = "AlwaysSameLine"
# Don't reformat anything.
# Default: false
disable_all_formatting = false
# Specifies which edition is used by the parser.
# Default: "2015"
edition = "2021"
# Put empty-body functions and impls on a single line.
# Default: true
empty_item_single_line = true
# The maximum length of enum variant having discriminant, that gets vertically aligned with others.
# Default: 0
enum_discrim_align_threshold = 0
# Error if Rustfmt is unable to get all lines within max_width, except for comments and string literals.
# Default: false
error_on_line_overflow = false
# Error if unable to get comments or string literals within max_width, or they are left with trailing whitespaces.
# Default: false
error_on_unformatted = false
# Maximum width of the args of a function call before falling back to vertical formatting.
# Default: 60
fn_call_width = 100
# Control the layout of parameters in function signatures.
# Default: "Tall"
fn_params_layout = "Vertical"
# Put single-expression functions on a single line.
# Default: false
fn_single_line = true
# Always print the abi for extern items.
# Default: true
force_explicit_abi = true
# Force multiline closure and match arm bodies to be wrapped in a block.
# Default: false
force_multiline_blocks = true
# Format code snippet included in doc comments.
# Default: false
format_code_in_doc_comments = true
# Max width for code snippets included in doc comments. Only used if format_code_in_doc_comments is true.
# Default: 100
doc_comment_code_block_width = 100
# Format generated files. A file is considered generated if any of the first five lines contain a @generated comment marker.
# Default: true
format_generated_files = true
# Format the metavariable matching patterns in macros.
# Default: false
format_macro_matchers = true
# Format the bodies of macros.
# Default: true
format_macro_bodies = true
# Skip formatting the bodies of macro invocations with the following names.
# Default: []
skip_macro_invocations = []
# Format string literals where necessary.
# Default: false
format_strings = false
# Use tab characters for indentation, spaces for alignment.
# Default: false
hard_tabs = false
# Control the case of the letters in hexadecimal literal values.
# Default: "Preserve"
hex_literal_case = "Upper"
# Do not show parse errors if the parser failed to parse files.
# Default: false
hide_parse_errors = false
# Indent style of imports.
# Default: "Block"
imports_indent = "Block"
# Item layout inside a imports block.
# Default: "Mixed"
imports_layout = "Vertical"
# Indent on expressions or items.
# Default: "Block"
indent_style = "Block"
# Write an item and its attribute on the same line if their combined width is below a threshold.
# Default: 0
inline_attribute_width = 0
# Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the => operator.
# Default: true
match_arm_blocks = true
# Controls whether to include a leading pipe on match arms.
# Default: "Never"
match_arm_leading_pipes = "Never"
# Put a trailing comma after a block based match arm (non-block arms are not affected).
# Default: false
match_block_trailing_comma = true
# Maximum width of each line.
# Default: 100
max_width = 100
# Merge multiple derives into a single one.
# Default: true
merge_derives = true
# Controls how imports are structured in use statements. Imports will be merged or split to the configured level of granularity.
# Default: "Preserve"
imports_granularity = "Crate"
# Unix or Windows line endings.
# Default: "Auto"
newline_style = "Unix"
# Convert /* */ comments to // comments where possible.
# Default: false
normalize_comments = true
# Convert #![doc] and #[doc] attributes to //! and /// doc comments.
# Default: false
normalize_doc_attributes = true
# 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: false
overflow_delimited_expr = false
# Remove nested parens.
# Default: true
remove_nested_parens = true
# Reorder impl items. type and const are put first, then macros and methods.
# Default: true
reorder_impl_items = true
# Reorder import and extern crate statements alphabetically in groups (a group is separated by a newline).
# Default: true
reorder_imports = true
# Controls the strategy for how consecutive imports are grouped together.
# Default: "StdExternalCrate"
group_imports = "StdExternalCrate"
# Reorder mod declarations alphabetically in group.
# Default: true
reorder_modules = true
# The width threshold for an array element to be considered "short".
# Default: 10
short_array_element_width_threshold = 0
# Don't reformat out of line modules.
# Default: false
skip_children = false
# Maximum line length for single line if-else expressions.
# Default: 50
single_line_if_else_max_width = 0
# Maximum line length for single line let-else statements.
# Default: 50
single_line_let_else_max_width = 0
# Leave a space after the colon.
# Default: true
space_after_colon = true
# Leave a space before the colon.
# Default: false
space_before_colon = false
# Put spaces around the .., ..=, and ... range operators.
# Default: false
spaces_around_ranges = false
# The maximum diff of width between struct fields to be aligned with each other.
# Default: 0
struct_field_align_threshold = 30
# Put small struct literals on a single line.
# Default: true
struct_lit_single_line = false
# Maximum width in the body of a struct literal before falling back to vertical formatting. A value of 0 (zero) results
# in struct literals always being broken into multiple lines. Note this occurs when use_small_heuristics is set to Off.
# Default: 18
struct_lit_width = 0
# Maximum width in the body of a struct variant before falling back to vertical formatting.
# Default: 35
struct_variant_width = 35
# Number of spaces per tab.
# Default: 4
tab_spaces = 4
# How to handle trailing commas for lists.
# Default: "Vertical"
trailing_comma = "Always"
# Add trailing semicolon after break, continue and return.
# Default: true
trailing_semicolon = true
# Determines if + or = are wrapped in spaces in the punctuation of types.
# Default: "Wide"
type_punctuation_density = "Wide"
# Use field initialize shorthand if possible.
# Default: false
use_field_init_shorthand = true
# Replace uses of the try! macro by the ? shorthand.
# Default: false
use_try_shorthand = true
# Break comments to fit on the line.
# Default: false
wrap_comments = true