-
Notifications
You must be signed in to change notification settings - Fork 0
/
rustfmt.toml
43 lines (33 loc) · 1.59 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
# rustfmt.toml
## web description of options: https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=
# required_version # specify rustfmt version requirement
# ignore = [] # files for rustfmt to ignore
version = "Two"
unstable_features = true
tab_spaces = 8 # legible groups! :)
# hard_tabs = true
## line lengths
max_width = 120
use_small_heuristics = "Max" # formatting based on sub-max_width lengths
## braces start at end of a line
brace_style = "SameLineWhere" # same line except after Where
control_brace_style = "AlwaysSameLine"
## sub element alignment with parent open delimiter
imports_indent = "Visual"
indent_style = "Visual"
## import organization
imports_granularity = "Crate" # group all imports for a crate together
group_imports = "StdExternalCrate" # category style grouping of imports (ala isort in python)
## ~function related
reorder_impl_items = true # assoc_type & const at top of impl
where_single_line = true # where on single line if few types
type_punctuation_density = "Compressed" # no spaces around (e.g.) TypeA+TypeB
## struct related
struct_field_align_threshold = 20 # move distance to seek type alignment in struct fields
use_field_init_shorthand = true # let _ = some_struct {x, y, z}
## various
inline_attribute_width = 50 # distance to allow attributes on same lines a what they tag
overflow_delimited_expr = true # no double nesting for vertical formatted lists, etc.
# ## questionable
# chain_width = 0 # default: 60
# format_strings = true # auto line-break strings (easier to read, more annoying to edit)