-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.rustfmt.toml
More file actions
43 lines (33 loc) · 1.92 KB
/
.rustfmt.toml
File metadata and controls
43 lines (33 loc) · 1.92 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
# rustfmt.toml
# web description of options: https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=
#
# NOTE: use *nightly* rust fmt
# ```zsh
# cargo +nightly fmt
# ```
## --- meta-config ---
style_edition = "2024"
unstable_features = true # `cargo +nightly fmt`
ignore = [] # files for rustfmt to ignore
# required_version # specify rustfmt version requirement
## --- regular-config ---
imports_indent = "Visual"
indent_style = "Visual" # nests inline with thing needing verticality
brace_style = "PreferSameLine" # braces start on line of what they connect to
chain_width = 30 # default: 60
struct_field_align_threshold = 20 # move distance to seek type alignment in struct fields
enum_discrim_align_threshold = 20 # move distance to seek type alignment in enum discriminants
match_arm_blocks = false # only use {} if multiple statements (vs multline single statements)
match_block_trailing_comma = true # commas between all match arms ({},)
imports_granularity = "Crate" # group all imports for a crate together
group_imports = "StdExternalCrate" # category style grouping of imports (ala isort in python)
format_macro_bodies = false
format_code_in_doc_comments = true
reorder_impl_items = true # assoc_type & const at top of impl
merge_derives = false # allow multiple #[derive(..)] chunks
## --- previously debated options ---
# tab_spaces = 8 # legible groups! (~; and is a lot when combiend iwth "Visual" styles)
# format_strings = true # auto line-break strings (easier to read, more annoying to edit)
# trailing_semicolon = false # no `;` after continue/break/return (allows, but doesn't enforce no trailing `;)
# inline_attribute_width=50 # distance to allow attributes on same lines a what they tag (visually surprising)
# use_field_init_shorthand = true # let _ = some_struct {x, y, z}