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 | |
| 19 | unstable_features = true |
| 20 | |
| 21 | edition = "2021" |
| 22 | |
| 23 | # Indentation: 4 spaces, not hard tabs. |
| 24 | hard_tabs = false |
| 25 | tab_spaces = 4 |
| 26 | |
| 27 | # Line width. |
| 28 | max_width = 100 |
| 29 | |
| 30 | # Unix line endings. |
| 31 | newline_style = "Unix" |
| 32 | |
| 33 | # Break parameters into vertical layout only when the signature does not fit. |
| 34 | fn_params_layout = "Tall" |
| 35 | |
| 36 | # Allow short functions on a single line: |
| 37 | # fn len(&self) -> usize { self.len() } |
| 38 | fn_single_line = true |
| 39 | |
| 40 | # Brace on same line unless there is a where clause. |
| 41 | brace_style = "SameLineWhere" |
| 42 | |
| 43 | # Preserve existing import granularity (don't merge/split use trees). |
| 44 | imports_granularity = "Preserve" |
| 45 | |
| 46 | # Keep each imported item on its own line inside use braces. |
| 47 | imports_layout = "Vertical" |
| 48 | |
| 49 | # Don't reorder imports: the codebase follows crate -> fe2o3 -> std -> third-party. |
| 50 | reorder_imports = false |
| 51 | reorder_modules = false |
| 52 | |
| 53 | # Binary operators: line break comes before the operator. |
| 54 | binop_separator = "Front" |
| 55 | |
| 56 | # Match arms: no extra block braces around the arm body. |
| 57 | match_arm_blocks = false |
| 58 | |
| 59 | # Trailing comma after block-based match arms (the codebase uses them). |
| 60 | match_block_trailing_comma = true |
| 61 | |
| 62 | # Trailing commas in vertical layouts. |
| 63 | trailing_comma = "Vertical" |
| 64 | |
| 65 | # Do NOT reformat string literals (the codebase has carefully formatted |
| 66 | # multi-line SQL, error messages, etc.). |
| 67 | format_strings = false |
| 68 | |
| 69 | # Align struct fields and enum discriminants whose name lengths differ |
| 70 | # by up to this threshold. |
| 71 | struct_field_align_threshold = 40 |
| 72 | enum_discrim_align_threshold = 40 |
| 73 | |
| 74 | # Keep comment formatting as-is. |
| 75 | wrap_comments = false |
| 76 | normalize_comments = false |
| 77 | |
| 78 | # Allow up to 2 consecutive blank lines (the codebase uses double blank |
| 79 | # lines as section separators). |
| 80 | blank_lines_upper_bound = 2 |
| 81 | |
| 82 | # Keep single-predicate where clauses compact. |
| 83 | where_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 | # }) |
| 91 | overflow_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). |
| 96 | use_small_heuristics = "Off" |
| 97 | fn_call_width = 60 |
| 98 | attr_fn_like_width = 70 |
| 99 | struct_lit_width = 60 |
| 100 | struct_variant_width = 35 |
| 101 | array_width = 60 |
| 102 | chain_width = 80 |
| 103 | single_line_if_else_max_width = 80 |
| 104 | single_line_let_else_max_width = 50 |