-
Notifications
You must be signed in to change notification settings - Fork 0
/
rustfmt.toml
63 lines (47 loc) · 1.13 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
#
# ref:
# - https://gist.github.com/haruleekim/55e015778a325c01866350d5b0b2cbba
# - https://github.com/rust-lang/rust/blob/master/rustfmt.toml
# - https://github.com/tikv/tikv/blob/master/rustfmt.toml
#
# Run rustfmt with this config (it should be picked up automatically).
version = "Two"
edition = "2021"
color = "Auto"
unstable_features = true
# 跳过指定目录
ignore = [
"docs",
]
# Basic
hard_tabs = false # 是否使用硬制表符
max_width = 100
use_small_heuristics = "Max"
# Imports
imports_granularity = "Crate"
# Sort
reorder_imports = true
reorder_modules = true
reorder_impl_items = true
merge_derives = true
# Format
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
# Force
force_multiline_blocks = false
# Consistency
newline_style = "Unix"
# Format comments
comment_width = 100
wrap_comments = true
# Misc
chain_width = 80
spaces_around_ranges = false
match_arm_leading_pipes = "Preserve"
match_arm_blocks = true # fix
match_block_trailing_comma = true
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true