Use rustfmt to enforce consistent formatting
This change adds a .rustfmt.toml that includes ALL supported settings, 12 of which we have overridden to attempt to cater to our own proclivities. rustfmt is checked in the rust-nightly CI job.
This commit is contained in:
84
.rustfmt.toml
Normal file
84
.rustfmt.toml
Normal file
@@ -0,0 +1,84 @@
|
||||
# https://github.com/rust-lang-nursery/rustfmt/blob/master/Configurations.md
|
||||
verbose = false
|
||||
disable_all_formatting = false
|
||||
skip_children = false
|
||||
max_width = 100
|
||||
error_on_line_overflow = false
|
||||
error_on_line_overflow_comments = false
|
||||
tab_spaces = 4
|
||||
fn_call_width = 60
|
||||
struct_lit_width = 18
|
||||
struct_variant_width = 35
|
||||
force_explicit_abi = true
|
||||
newline_style = "Unix"
|
||||
fn_brace_style = "SameLineWhere"
|
||||
item_brace_style = "SameLineWhere"
|
||||
control_style = "Rfc"
|
||||
control_brace_style = "AlwaysSameLine"
|
||||
impl_empty_single_line = true
|
||||
trailing_comma = "Vertical"
|
||||
trailing_semicolon = true
|
||||
fn_empty_single_line = true
|
||||
fn_single_line = false
|
||||
fn_return_indent = "WithArgs"
|
||||
fn_args_paren_newline = false
|
||||
fn_args_density = "Tall"
|
||||
fn_args_layout = "Block"
|
||||
array_layout = "Block"
|
||||
array_width = 60
|
||||
array_horizontal_layout_threshold = 0
|
||||
type_punctuation_density = "Wide"
|
||||
where_style = "Rfc"
|
||||
where_density = "CompressedIfEmpty"
|
||||
where_layout = "Vertical"
|
||||
where_pred_indent = "Visual"
|
||||
generics_indent = "Block"
|
||||
struct_lit_style = "Block"
|
||||
struct_lit_multiline_style = "ForceMulti"
|
||||
fn_call_style = "Visual"
|
||||
report_todo = "Never"
|
||||
report_fixme = "Never"
|
||||
chain_indent = "Block"
|
||||
chain_one_line_max = 60
|
||||
chain_split_single_child = false
|
||||
imports_indent = "Block"
|
||||
imports_layout = "HorizontalVertical"
|
||||
reorder_extern_crates = true
|
||||
reorder_extern_crates_in_group = true
|
||||
reorder_imports = true
|
||||
reorder_imports_in_group = true
|
||||
reorder_imported_names = true
|
||||
single_line_if_else_max_width = 50
|
||||
format_strings = true
|
||||
force_format_strings = false
|
||||
take_source_hints = false
|
||||
hard_tabs = false
|
||||
wrap_comments = false
|
||||
comment_width = 80
|
||||
normalize_comments = false
|
||||
wrap_match_arms = true
|
||||
match_block_trailing_comma = false
|
||||
indent_match_arms = true
|
||||
match_pattern_separator_break_point = "Back"
|
||||
closure_block_indent_threshold = 0
|
||||
space_before_type_annotation = false
|
||||
space_after_type_annotation_colon = true
|
||||
space_before_struct_lit_field_colon = false
|
||||
space_after_struct_lit_field_colon = true
|
||||
space_before_bound = false
|
||||
space_after_bound_colon = true
|
||||
spaces_around_ranges = false
|
||||
spaces_within_angle_brackets = false
|
||||
spaces_within_square_brackets = false
|
||||
spaces_within_parens = false
|
||||
use_try_shorthand = true
|
||||
write_mode = "Overwrite"
|
||||
condense_wildcard_suffixes = false
|
||||
combine_control_expr = true
|
||||
struct_field_align_threshold = 0
|
||||
remove_blank_lines_at_start_or_end_of_block = true
|
||||
attributes_on_same_line_as_field = true
|
||||
attributes_on_same_line_as_variant = true
|
||||
multiline_closure_forces_block = false
|
||||
multiline_match_arm_forces_block = false
|
||||
merge_derives = true
|
||||
Reference in New Issue
Block a user