-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrustfmt.toml
More file actions
46 lines (38 loc) · 2.29 KB
/
rustfmt.toml
File metadata and controls
46 lines (38 loc) · 2.29 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
unstable_features = true # Enable unstable features (requires nightly)
edition = "2024" # Rust edition
style_edition = "2024" # Style edition for formatting
hard_tabs = true # Use tabs for indentation
max_width = 128 # Maximum width of each line
# Imports
group_imports = "StdExternalCrate" # Group imports: Std, External, then Crate
imports_granularity = "Crate" # Import granularity: group by crate
reorder_imports = true # Reorder imports alphabetically
reorder_modules = true # Reorder module declarations
# Comments
wrap_comments = true # Wrap comments to max_width
normalize_comments = true # Normalize comment style
format_code_in_doc_comments = true # Format code blocks in doc comments
# Shorthand
use_field_init_shorthand = true # Use field init shorthand where possible
use_try_shorthand = true # Use ? instead of try! macro
# Alignment thresholds
enum_discrim_align_threshold = 20 # Align enum discriminants if <= threshold
struct_field_align_threshold = 20 # Align struct fields if <= threshold
# Formatting options
reorder_impl_items = true # Reorder items in impl blocks
condense_wildcard_suffixes = true # Condense wildcard suffixes in patterns
format_strings = true # Format string literals
format_macro_matchers = true # Format macro matchers
format_macro_bodies = true # Format macro bodies
newline_style = "Unix" # Use Unix-style newlines
blank_lines_upper_bound = 2 # Max blank lines between items
blank_lines_lower_bound = 0 # Min blank lines between items
# Macros
skip_macro_invocations = ["ensure"] # Skip formatting for these macros
# Misc
force_explicit_abi = true # Always require explicit ABI in extern blocks
merge_derives = true # Merge multiple derives into a single attribute
normalize_doc_attributes = true # Normalize doc attributes
# Advanced (optional, comment out if not needed)
# error_on_line_overflow = true # Error if line exceeds max_width
# error_on_unformatted = true # Error if file cannot be formatted