Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/rustfmt.toml

3.1 KiB, 1 run

created by r1870400018:11641, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1# Rustfmt configuration for the fe2o3 (Hematite) library.
2# Requires nightly: cargo +nightly fmt
3# On stable, unstable options are silently ignored with a warning.
4#
5# KNOWN LIMITATIONS
6# rustfmt cannot reproduce these fe2o3 style patterns:
7# - Return type on its own indented line after multi-line fn params:
8# fn foo( rustfmt produces: fn foo(
9# x: T, x: T,
10# ) ) -> ReturnType {
11# -> ReturnType
12# {
13# - Tab alignment between param name and type (len:\tType)
14# or space-column alignment in fn params (peer: SocketAddr).
15# - Manual column alignment in match arms ("exact" =>).
16# - Blank line after opening brace in impl blocks.
17# Use #[rustfmt::skip] for blocks that rely on these patterns.
18
19unstable_features = true
20
21edition = "2021"
22
23# Indentation: 4 spaces, not hard tabs.
24hard_tabs = false
25tab_spaces = 4
26
27# Line width.
28max_width = 100
29
30# Unix line endings.
31newline_style = "Unix"
32
33# Break parameters into vertical layout only when the signature does not fit.
34fn_params_layout = "Tall"
35
36# Allow short functions on a single line:
37# fn len(&self) -> usize { self.len() }
38fn_single_line = true
39
40# Brace on same line unless there is a where clause.
41brace_style = "SameLineWhere"
42
43# Preserve existing import granularity (don't merge/split use trees).
44imports_granularity = "Preserve"
45
46# Keep each imported item on its own line inside use braces.
47imports_layout = "Vertical"
48
49# Don't reorder imports: the codebase follows crate -> fe2o3 -> std -> third-party.
50reorder_imports = false
51reorder_modules = false
52
53# Binary operators: line break comes before the operator.
54binop_separator = "Front"
55
56# Match arms: no extra block braces around the arm body.
57match_arm_blocks = false
58
59# Trailing comma after block-based match arms (the codebase uses them).
60match_block_trailing_comma = true
61
62# Trailing commas in vertical layouts.
63trailing_comma = "Vertical"
64
65# Do NOT reformat string literals (the codebase has carefully formatted
66# multi-line SQL, error messages, etc.).
67format_strings = false
68
69# Align struct fields and enum discriminants whose name lengths differ
70# by up to this threshold.
71struct_field_align_threshold = 40
72enum_discrim_align_threshold = 40
73
74# Keep comment formatting as-is.
75wrap_comments = false
76normalize_comments = false
77
78# Allow up to 2 consecutive blank lines (the codebase uses double blank
79# lines as section separators).
80blank_lines_upper_bound = 2
81
82# Keep single-predicate where clauses compact.
83where_single_line = true
84
85# Allow trailing bracket/brace expressions to overflow into subsequent
86# lines. Matches the codebase pattern:
87# Error::Upstream(Arc::new(e), ErrMsg {
88# tags: &[...],
89# msg: String::new(),
90# })
91overflow_delimited_expr = true
92
93# Width heuristics: explicit control.
94# fn_call_width kept at 60 to preserve multi-line macro invocations
95# like res!(long_call(), Tag1, Tag2).
96use_small_heuristics = "Off"
97fn_call_width = 60
98attr_fn_like_width = 70
99struct_lit_width = 60
100struct_variant_width = 35
101array_width = 60
102chain_width = 80
103single_line_if_else_max_width = 80
104single_line_let_else_max_width = 50