From d617d74fa48ca5bfdf548755e9a5e2754a18b251 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Thu, 23 Aug 2018 09:10:50 -0400 Subject: [PATCH] Add rustfmt.toml and update travis to check formatting --- .travis.yml | 6 ++++++ rustfmt.toml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 rustfmt.toml diff --git a/.travis.yml b/.travis.yml index 8c91a74..4e65a66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,12 @@ rust: - stable - beta - nightly +before_script: + - rustup component add rustfmt-preview +script: + - cargo fmt all -- --check + - cargo build + - cargo test matrix: allow_failures: - rust: nightly diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..1aabd5c --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,17 @@ +indent_style = "Visual" +format_strings = true +format_macro_matchers = true +imports_layout = "HorizontalVertical" +merge_imports = true +match_block_trailing_comma = true +merge_derives = true +newline_style = "Unix" +normalize_comments = true +reorder_impl_items = true +space_after_colon = true +space_before_colon = false +struct_lit_single_line = false +type_punctuation_density = "Wide" +use_field_init_shorthand = true +use_try_shorthand = true +wrap_comments = true