-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrustfmt.toml
72 lines (52 loc) · 2.16 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
########################################################
# Basic Configuration
########################################################
# Because `merge_imports` is deprecated, use this instead:
imports_granularity = "Crate"
# Keep imports sorted
reorder_imports = true
# Group standard-library vs. external crate imports
group_imports = "StdExternalCrate"
# Reorder mod statements
reorder_modules = true
# Force Unix line endings
newline_style = "Unix"
# The target maximum width of a line
max_width = 100
# Indentation style: "Visual" can give a more column-like alignment
indent_style = "Visual"
########################################################
# Alignment & Layout
########################################################
# Align struct fields if the longest field name is <= threshold
# Increase beyond 20 if you want deeper alignment.
struct_field_align_threshold = 20
# Enum discriminant alignment is often unstable, but if your rustfmt
# version supports it and doesn't warn, set it:
enum_discrim_align_threshold = 20
# Layout for function parameters: "Tall" (default), "Compressed", or "Vertical".
# "Vertical" is somewhat more “columnar” if you have multiple parameters.
fn_params_layout = "Vertical"
# No stable option for controlling function call alignment beyond
# `fn_call_width` + `indent_style = "Visual"`
# so let’s set fn_call_width to a smaller threshold, forcing wrapping:
fn_call_width = 60
########################################################
# Comments & Code Blocks
########################################################
# Wrap comments (including doc comments) at max_width
wrap_comments = true
# Attempt to format code blocks in doc comments
format_code_in_doc_comments = true
########################################################
# Other Tweaks
########################################################
# Use shorthand field initialization (Foo { x, y }).
use_field_init_shorthand = true
# If you want to reorder impl items (unstable):
# reorder_impl_items = true
# You can also normalize block comment style:
normalize_comments = true
normalize_doc_attributes = true
# Additional string formatting at line breaks
format_strings = true