-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrustfmt.toml
More file actions
52 lines (45 loc) · 1.68 KB
/
rustfmt.toml
File metadata and controls
52 lines (45 loc) · 1.68 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
# source of truth: the most recent version of the formatting configuration can be found at
# https://gitea.basebox.health/basebox/broker/issues/24
#
# running:
# make sure to run with nightly rustfmt, e.g. `cargo +nightly fmt`
tab_spaces = 2
# I can't rely on contributors using .editorconfig
newline_style = "Unix"
# require the shorthand instead of it being optional
use_field_init_shorthand = true
# outdated default — `?` was unstable at the time
# additionally the `try!` macro is deprecated now
use_try_shorthand = true
# Max to use the 100 char width for everything or Default. See https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#use_small_heuristics
use_small_heuristics = "Max"
# Unstable features below
unstable_features = true
style_edition = "2024"
# code can be 100 characters, why not comments?
wrap_comments = true
comment_width = 100
# force contributors to follow the formatting requirement
error_on_line_overflow = true
# next 4: why not?
format_code_in_doc_comments = true
format_macro_bodies = true
format_macro_matchers = true
format_strings = true
# better grepping
imports_granularity = "Module"
# quicker manual lookup
group_imports = "StdExternalCrate"
# why use an attribute if a normal doc comment would suffice?
normalize_doc_attributes = true
# trailing semicolon for explicit returns
trailing_semicolon = true
struct_field_align_threshold = 20
struct_lit_single_line = false
single_line_if_else_max_width = 0
single_line_let_else_max_width = 0
empty_item_single_line = false
brace_style = "PreferSameLine"
# Some wanted formatting which rustfmt dislikes should be left alone, e.g.
# I want to decide when and if I wrap chained methods.
error_on_unformatted = false