-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrustfmt.toml
More file actions
115 lines (99 loc) · 3.21 KB
/
Copy pathrustfmt.toml
File metadata and controls
115 lines (99 loc) · 3.21 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
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
# Includes all non-deprecated rustfmt configuration options, as of v1.8.0.
# https://rust-lang.github.io/rustfmt/?version=v1.8.0
# - Default values are used unless otherwise specified.
# - Some width rules are disabled to allow for fallback to `max_width`.
# Formatter Settings
color = "Auto"
disable_all_formatting = false
# edition -- specified by Cargo.toml
error_on_line_overflow = false
error_on_unformatted = false
format_generated_files = true
generated_marker_line_search_limit = 5 # Only relevant if `format_generated_files` is true.
show_parse_errors = true
ignore = []
# required_version -- specified by CARGO_PKG_VERSION
# style_edition -- causes formatting to fail
unstable_features = true # Default: false
# version -- DEPRECATED
# Imports and Modules
reorder_imports = true # Reorder imports alphabetically.
group_imports = "StdExternalCrate" # Default: "Preserve"
imports_indent = "Block"
imports_layout = "Mixed"
imports_granularity = "Crate" # Default: "Preserve"
# merge_imports -- DEPRECATED, use `imports_granularity` instead.
reorder_modules = true # Reorder modules alphabetically.
# Tabs
hard_tabs = false
tab_spaces = 2 # Default: 4
# Width Rules
max_width = 120 # Default: 100
use_small_heuristics = "Default"
# These are a percentage of `max_width` when `use_small_heuristics` is "Default".
array_width = 60
attr_fn_like_width = 70
chain_width = 60
comment_width = 80
fn_call_width = 60
struct_lit_width = 18
struct_variant_width = 35
short_array_element_width_threshold = 10
single_line_if_else_max_width = 50
single_line_let_else_max_width = 50
# Wrapping
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
empty_item_single_line = true
fn_params_layout = "Tall"
fn_single_line = false
force_multiline_blocks = false
inline_attribute_width = 0
match_arm_blocks = true
struct_lit_single_line = true
where_single_line = false
wrap_comments = false
# Doc Comments
format_code_in_doc_comments = false
doc_comment_code_block_width = 100 # Only relevant if `format_code_in_doc_comments` is true.
normalize_doc_attributes = false
# Macros
format_macro_matchers = true # Default: false
format_macro_bodies = true
skip_macro_invocations = []
# Blank Lines
blank_lines_lower_bound = 0
blank_lines_upper_bound = 1
[blank_lines_by_context]
top_level = { upper = 1, lower = 1 }
mod_items = { upper = 1, lower = 1 }
trait_items = { upper = 0, lower = 0 }
impl_items = { upper = 0, lower = 0 }
fn_body = { upper = 1, lower = 0 }
# Miscellaneous
binop_separator = "Front"
combine_control_expr = true
condense_wildcard_suffixes = false
enum_discrim_align_threshold = 0
force_explicit_abi = true
format_strings = false
hex_literal_case = "Upper" # Default: "Preserve"
indent_style = "Block"
match_arm_leading_pipes = "Never"
match_block_trailing_comma = false
merge_derives = true
newline_style = "Auto"
normalize_comments = false
overflow_delimited_expr = false
remove_nested_parens = true
reorder_impl_items = false
skip_children = false
space_after_colon = true
space_before_colon = false
spaces_around_ranges = false
struct_field_align_threshold = 0
trailing_comma = "Vertical"
trailing_semicolon = true
type_punctuation_density = "Wide"
use_field_init_shorthand = false
use_try_shorthand = true # Default: false