Skip to content

Commit 79774b2

Browse files
committed
Add a rustfmt configuration file with explicit ignores
Add a configuration file but explicitly ignore all source files. The aim of this is that we can then un-ignore files a few at a time and deal with issues in a small isolated manner.
1 parent 3d7d979 commit 79774b2

File tree

1 file changed

+87
-1
lines changed

1 file changed

+87
-1
lines changed

rustfmt.toml

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

0 commit comments

Comments
 (0)