22# r u s t f m t - C O N F I G
33# ==================================================================================
44#
5- # Version: 0.7.1
6- # Author : Robbepop <robbepop@web.de>
5+ # Original: Robbepop <robbepop@web.de>
6+ # Updated to remove options no longer supported by rustfmt stable (1.9.0+).
77#
8- # A predefined .rustfmt.toml file with all configuration options and their
9- # associated description, possible values and default values for use in other
10- # projects.
11- #
12- # This should actually automatically be shipped with cargo fmt or rustfmt itself!
8+ # Only `max_width = 100` is active. Uncomment others to customize.
9+ # Run `rustfmt --print-config=default <any-file.rs>` to see all current defaults.
1310# ----------------------------------------------------------------------------------
1411
15- # Use verbose output.
16- # Default: false
17- # verbose =
18-
1912# Do not reformat out of line modules.
2013# Default: false
2114# skip_children =
2215
23- # Lines to format; this is not supported in rustfmt.toml,
24- # and can only be specified via the --file-lines option.
25- # file_lines =
26-
2716# Maximum width of each line.
2817# Default: 100
29- # max_width =
30-
31- # Ideal width of each line.
32- # Default: 80
3318max_width = 100
3419
3520# Number of spaces per tab.
3621# Default: 4
37- # tab_spaces =
22+ # tab_spaces =
3823
39- # Maximum width of the args of a function call before
40- # falling back to vertical formatting.
24+ # Use tab characters for indentation, spaces for alignment.
25+ # Default: false
26+ # hard_tabs =
27+
28+ # Maximum width of the args of a function call before falling back to vertical formatting.
4129# Default: 60
4230# fn_call_width =
4331
44- # Maximum width in the body of a struct lit before falling back to vertical formatting.
45- # Default: 16
32+ # Maximum width in the body of a struct literal before falling back to vertical formatting.
33+ # Default: 18
4634# struct_lit_width =
4735
4836# Maximum width in the body of a struct variant before falling back to vertical formatting.
@@ -54,171 +42,68 @@ max_width = 100
5442# force_explicit_abi =
5543
5644# Unix or Windows line endings.
57- # Values: Windows | Unix | Native
58- # Default: Unix
45+ # Values: Auto | Windows | Unix | Native
46+ # Default: Auto
5947# newline_style =
6048
61- # Brace style for functions.
49+ # Brace style for functions, structs, and enums.
50+ # (Previously split into fn_brace_style and item_brace_style.)
6251# Values: AlwaysNextLine | PreferSameLine | SameLineWhere
6352# Default: SameLineWhere
64- # fn_brace_style =
53+ # brace_style =
6554
66- # Brace style for structs and enums.
67- # Values: AlwaysNextLine | PreferSameLine | SameLineWhere
68- # Default: SameLineWhere
69- # item_brace_style =
70-
71- # Brace style for control flow construct.
55+ # Brace style for control flow constructs.
7256# Values: AlwaysSameLine | ClosingNextLine | AlwaysNextLine
7357# Default: AlwaysSameLine
7458# control_brace_style =
7559
76- # Put empty-body implementations on a single line.
60+ # Put empty-body implementations and functions on a single line.
61+ # (Previously impl_empty_single_line / fn_empty_single_line.)
7762# Default: true
78- # impl_empty_single_line =
79-
80- # Put empty-body functions on a single line.
81- # Default: true
82- # fn fn_empty_single_line =
63+ # empty_item_single_line =
8364
8465# Put single-expression functions on a single line.
8566# Default: false
8667# fn_single_line =
8768
88- # Location of return type in function declaration.
89- # Values: WithArgs | WithWhereClause
90- # Default: WithArgs
91- # fn_return_indent =
92-
93- # If function argument parenthesis goes on a newline.
94- # Default: true
95- # fn_args_paren_newline =
96-
97- # Argument density in functions.
98- # Values: Compressed | Tall | CompressedIfEmpty | Vertical
69+ # Layout of function parameters.
70+ # (Previously fn_args_layout / fn_args_density.)
71+ # Values: Compressed | Tall | Vertical
9972# Default: Tall
100- # fn_args_density =
101-
102- # Layout of function arguments.
103- # Values: Visual | Block | BlockAlways
104- # Default: Visual
105- # fn_args_layout =
106-
107- # Indent on function arguments.
108- # Values: Inherit | Tabbed | Visual
109- # Default: Visual
110- # fn_arg_indent =
73+ # fn_params_layout =
11174
11275# Determines if '+' or '=' are wrapped in spaces in the punctuation of types.
11376# Values: Compressed | Wide
11477# Default: Wide
11578# type_punctuation_density =
11679
117- # Density of a where clause.
118- # Values: Compressed | Tall | CompressedIfEmpty | Vertical
119- # Default: CompressedIfEmpty
120- # where_density =
121-
122- # Indentation of a where clause.
123- # Values: Inherit | Tabbed | Visual
124- # Default: Tabbed
125- # where_indent =
126-
127- # Element layout inside a where clause.
128- # Values: Vertical | Horizontal | HorizontalVertical | Mixed
129- # Default: Vertical
130- # where_layout =
131-
132- # Indentation style of a where predicate.
133- # Values: Inherit | Tabbed | Visual
134- # Default: Visual
135- # where_pred_indent =
136-
137- # Put a trailing comma on where clauses.
138- # Default: false
139- # where_trailing_comma =
140-
141- # Indentation of generics.
142- # Values: Inherit | Tabbed | Visual
143- # Default: Visual
144- # generics_indent =
145-
146- # If there is a trailing comma on structs.
80+ # Trailing comma behavior for structs, enums, and struct literals.
81+ # (Previously struct_trailing_comma / struct_lit_trailing_comma / enum_trailing_comma.)
14782# Values: Always | Never | Vertical
14883# Default: Vertical
149- # struct_trailing_comma =
84+ # trailing_comma =
15085
151- # If there is a trailing comma on literal structs.
152- # Values: Always | Never | Vertical
153- # Default: Vertical
154- # struct_lit_trailing_comma =
155-
156- # Style of struct definition.
157- # Values: Visual | Block
158- # Default: Block
159- # struct_lit_style =
160-
161- # Multiline style on literal structs.
162- # Values: PreferSingle | ForceMulti
163- # Default: PreferSingle
164- # struct_lit_multiline_style =
165-
166- # Put a trailing comma on enum declarations.
167- # Default: true
168- # enum_trailing_comma =
169-
170- # Report all, none or unnumbered occurrences of TODO in source file comments.
171- # Values: Always | Unnumbered | Never
172- # Default: Never
173- # report_todo =
174-
175- # Report all, none or unnumbered occurrences of FIXME in source file comments.
176- # Values: Always | Unnumbered | Never
177- # Default: Never
178- # report_fixme =
179-
180- # Indent on chain base.
181- # Values: Inherit | Tabbed | Visual
182- # Default: Tabbed
183- # chain_base_indent =
184-
185- # Indentation of chain.
186- # Values: Inherit | Tabbed | Visual
187- # Default: Tabbed
188- # chain_indent =
86+ # Put a trailing comma after a block based match arm.
87+ # Default: false
88+ # match_block_trailing_comma =
18989
190- # Allow last call in method chain to break the line.
90+ # Wrap multiline match arms in blocks.
91+ # (Previously wrap_match_arms.)
19192# Default: true
192- # chains_overflow_last =
93+ # match_arm_blocks =
19394
19495# Reorder import statements alphabetically.
195- # Default: false
96+ # Default: true
19697# reorder_imports =
19798
198- # Reorder lists of names in import statements alphabetically.
199- # Default: false
200- # reorder_imported_names =
201-
20299# Maximum line length for single line if-else expressions.
203100# A value of zero means always break if-else expressions.
204101# Default: 50
205102# single_line_if_else_max_width =
206103
207104# Format string literals where necessary.
208- # Default: true
209- # format_strings =
210-
211- # Always format string literals.
212105# Default: false
213- # force_format_strings =
214-
215- # Retain some formatting characteristics from the source code.
216- # Default: true
217- # take_source_hints =
218-
219- # Use tab characters for indentation, spaces for alignment.
220- # Default: false
221- # hard_tabs =
106+ # format_strings =
222107
223108# Break comments to fit on the line.
224109# Default: false
@@ -228,65 +113,24 @@ max_width = 100
228113# Default: false
229114# normalize_comments =
230115
231- # Wrap multiline match arms in blocks.
232- # Default: true
233- # wrap_match_arms =
234-
235- # Put a trailing comma after a block based match arm (non-block arms are not affected).
236- # Default: false
237- # match_block_trailing_comma =
238-
239- # Put a trailing comma after a wildcard arm.
240- # Default: true
241- # match_wildcard_trailing_comma =
242-
243- # How many lines a closure must have before it is block indented.
244- # -1 means never use block indent.
245- # Type: <signed integer>
246- # Default: 5
247- # closure_block_indent_threshold =
248-
249- # Leave a space before the colon in a type annotation.
250- # Default: false
251- # space_before_type_annotation =
252-
253- # Leave a space after the colon in a type annotation.
254- # Default: true
255- # space_after_type_annotation_colon =
256-
257- # Leave a space before the colon in a trait or lifetime bound.
258- # Default: false
259- # space_before_bound =
260-
261- # Leave a space after the colon in a trait or lifetime bound.
262- # Default: true
263- # space_after_bound_colon =
264-
265- # Put spaces around the .. and ... range operators.
116+ # Put spaces around the .. and ... range operators.
266117# Default: false
267118# spaces_around_ranges =
268119
269- # Put spaces within non-empty generic arguments.
120+ # Leave a space before the colon in type annotations and trait/lifetime bounds.
121+ # (Previously space_before_type_annotation / space_before_bound.)
270122# Default: false
271- # spaces_within_angle_brackets =
123+ # space_before_colon =
272124
273- # Put spaces within non-empty square brackets.
274- # Default: false
275- # spaces_within_square_brackets =
276-
277- # Put spaces within non-empty parentheses.
278- # Default: false
279- # spaces_within_parens =
125+ # Leave a space after the colon in type annotations and trait/lifetime bounds.
126+ # (Previously space_after_type_annotation_colon / space_after_bound_colon.)
127+ # Default: true
128+ # space_after_colon =
280129
281130# Replace uses of the try! macro by the ? shorthand.
282131# Default: false
283132# use_try_shorthand =
284133
285- # What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage.
286- # Values: Replace | Overwrite | Display | Diff | Coverage | Plain | Checkstyle
287- # Default: Replace
288- # write_mode =
289-
290134# Replace strings of _ wildcards by a single .. in tuple patterns.
291135# Default: false
292- # condense_wildcard_suffices =
136+ # condense_wildcard_suffixes =
0 commit comments