From 66bc8f47038397a10236814f9870a2fb21cb0e9d Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 19 Jul 2021 16:44:24 +0200 Subject: [PATCH 1/2] feat: rustfmt.toml Copied from substrate. --- rustfmt.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 000000000000..1c9ebe03c02e --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,22 @@ +# Basic +hard_tabs = true +max_width = 100 +use_small_heuristics = "Max" +# Imports +imports_granularity = "Crate" +reorder_imports = true +# Consistency +newline_style = "Unix" +normalize_comments = true +normalize_doc_attributes = true +# Misc +chain_width = 80 +spaces_around_ranges = false +binop_separator = "Back" +reorder_impl_items = false +match_arm_leading_pipes = "Preserve" +match_arm_blocks = false +match_block_trailing_comma = true +trailing_comma = "Vertical" +trailing_semicolon = false +use_field_init_shorthand = true From 2a49df16933d402db29253dd02a31700db73ffa1 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 19 Jul 2021 17:21:43 +0200 Subject: [PATCH 2/2] avoid normalize It has some odd side effects converting // to /* */ instead of the other way round. --- rustfmt.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 1c9ebe03c02e..15e9bdcdf10f 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -7,8 +7,6 @@ imports_granularity = "Crate" reorder_imports = true # Consistency newline_style = "Unix" -normalize_comments = true -normalize_doc_attributes = true # Misc chain_width = 80 spaces_around_ranges = false