-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrustfmt.toml
More file actions
64 lines (49 loc) · 1.79 KB
/
Copy pathrustfmt.toml
File metadata and controls
64 lines (49 loc) · 1.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
# Rust Formatter Configuration for Robson v2
# Enforces consistent code style across all crates
# Edition (align with workspace Cargo.toml)
edition = "2021"
# Line width (default: 100, we use 100 for readability)
max_width = 100
# Hard tabs vs spaces (use spaces for consistency)
hard_tabs = false
tab_spaces = 4
# Imports
imports_granularity = "Crate" # Group imports by crate
group_imports = "StdExternalCrate" # std, external, local
reorder_imports = true
# Functions
fn_params_layout = "Tall" # Each param on new line if exceeds max_width
fn_call_width = 80
# Structs and enums
struct_lit_width = 40 # Max width before breaking struct literals
enum_discrim_align_threshold = 20
# Chains (method calls)
chain_width = 80
use_small_heuristics = "Default"
# Comments
wrap_comments = true
comment_width = 80
normalize_comments = true
normalize_doc_attributes = true
# Formatting
use_field_init_shorthand = true # Use `field` instead of `field: field`
use_try_shorthand = true # Use `?` instead of `try!`
force_explicit_abi = true # Require explicit `extern "C"`
# Newlines
newline_style = "Unix" # LF only (not CRLF)
blank_lines_upper_bound = 2 # Max consecutive blank lines
blank_lines_lower_bound = 0
# Match statements
match_arm_blocks = true # Force braces for match arms with single expr
match_block_trailing_comma = true
# Control flow
control_brace_style = "AlwaysSameLine" # `} else {` on same line
brace_style = "SameLineWhere"
# Where clauses
where_single_line = false # Always break where clauses to new lines
# Miscellaneous
remove_nested_parens = true # Simplify `((x))` to `(x)`
spaces_around_ranges = false # `0..10` not `0 .. 10`
overflow_delimited_expr = true # Allow breaking long expressions
# Doc comments
format_code_in_doc_comments = true # Format code blocks in /// comments