Skip to content

Commit 7e3c893

Browse files
committed
Introduce rustfmt config file
As we did in `rust-bitcoin` introduced a `rustfmt` configuration file that is palatable to devs. Do not run formatter, that is done as a separate patch to assist review.
1 parent 5a54694 commit 7e3c893

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

rustfmt.toml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,82 @@
1-
disable_all_formatting = true
1+
# Eventually this shoud be: ignore = []
2+
ignore = [
3+
"secp256k1-sys"
4+
]
5+
6+
hard_tabs = false
7+
tab_spaces = 4
8+
newline_style = "Auto"
9+
indent_style = "Block"
10+
11+
max_width = 100 # This is number of characters.
12+
# `use_small_heuristics` is ignored if the granular width config values are explicitly set.
13+
use_small_heuristics = "Max" # "Max" == All granular width settings same as `max_width`.
14+
# # Granular width configuration settings. These are percentages of `max_width`.
15+
# fn_call_width = 60
16+
# attr_fn_like_width = 70
17+
# struct_lit_width = 18
18+
# struct_variant_width = 35
19+
# array_width = 60
20+
# chain_width = 60
21+
# single_line_if_else_max_width = 50
22+
23+
wrap_comments = false
24+
format_code_in_doc_comments = false
25+
comment_width = 100 # Default 80
26+
normalize_comments = false
27+
normalize_doc_attributes = false
28+
format_strings = false
29+
format_macro_matchers = false
30+
format_macro_bodies = true
31+
hex_literal_case = "Preserve"
32+
empty_item_single_line = true
33+
struct_lit_single_line = true
34+
fn_single_line = true # Default false
35+
where_single_line = false
36+
imports_indent = "Block"
37+
imports_layout = "Mixed"
38+
imports_granularity = "Module" # Default "Preserve"
39+
group_imports = "StdExternalCrate" # Default "Preserve"
40+
reorder_imports = true
41+
reorder_modules = true
42+
reorder_impl_items = false
43+
type_punctuation_density = "Wide"
44+
space_before_colon = false
45+
space_after_colon = true
46+
spaces_around_ranges = false
47+
binop_separator = "Front"
48+
remove_nested_parens = true
49+
combine_control_expr = true
50+
overflow_delimited_expr = false
51+
struct_field_align_threshold = 0
52+
enum_discrim_align_threshold = 0
53+
match_arm_blocks = false # Default true
54+
match_arm_leading_pipes = "Never"
55+
force_multiline_blocks = false
56+
fn_args_layout = "Tall"
57+
brace_style = "SameLineWhere"
58+
control_brace_style = "AlwaysSameLine"
59+
trailing_semicolon = true
60+
trailing_comma = "Vertical"
61+
match_block_trailing_comma = false
62+
blank_lines_upper_bound = 1
63+
blank_lines_lower_bound = 0
64+
edition = "2018"
65+
version = "One"
66+
inline_attribute_width = 0
67+
format_generated_files = true
68+
merge_derives = true
69+
use_try_shorthand = false
70+
use_field_init_shorthand = false
71+
force_explicit_abi = true
72+
condense_wildcard_suffixes = false
73+
color = "Auto"
74+
required_version = "1.5.1"
75+
unstable_features = false
76+
disable_all_formatting = false
77+
skip_children = false
78+
hide_parse_errors = false
79+
error_on_line_overflow = false
80+
error_on_unformatted = false
81+
emit_mode = "Files"
82+
make_backup = false

0 commit comments

Comments
 (0)