-
Notifications
You must be signed in to change notification settings - Fork 1
/
rustfmt.toml
40 lines (32 loc) · 1.27 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
# Allow using unstable features in stable rustfmt (if they have shipped).
unstable_features = true
# Fix up imports.
reorder_imports = true
# Keep all imports in one big list.
# Chosen because I keep them folded, and this makes them less visible.
group_imports = "One"
# One import line per thing being imported.
# Chosen because it keeps refactoring easy.
imports_granularity = "Item"
# Wrap comments too.
wrap_comments = true
# Wrap comments at the same place as code, default is 80.
# Refs: https://github.com/rust-lang/rustfmt/issues/3349#issuecomment-622522913
comment_width = 100
format_code_in_doc_comments = true
# Reorder mod declarations alphabetically in group.
reorder_modules = true
# Types before functions in trait impls.
reorder_impl_items = true
# Use `MyStruct {a, b, c}` where possible not `MyStruct {a: a, b: b, c: c}`.
use_field_init_shorthand = true
# Try to format long strings.
# https://github.com/rust-lang/rustfmt/issues/3863
format_strings = true
# Error if the line was still too long after we formatted.
error_on_line_overflow = true
# Error if rustfmt failed to format something.
# Can be run with `cargo +nightly fmt -- --config error_on_unformatted=true`
# error_on_unformatted = true
# Error on TODOs (use FIXME for long-running things).
# report_todo = "Always"