From 1dd471bd1e4cbec3bae3830e5054c7452528d42b Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Tue, 12 May 2020 20:59:24 +0530 Subject: [PATCH] Add cargo fmt to travis build config --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f6ee92..7eb6ab8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,13 @@ rust: - beta - nightly script: + - | + if [[ $TRAVIS_RUST_VERSION == *stable* ]] + then + rustup component add rustfmt + cargo fmt --version + cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt --version))"; false) + fi - cargo build --verbose --all - cargo run --example nested_struct - cargo run --example simple @@ -11,4 +18,4 @@ script: os: - windows - osx - - linux \ No newline at end of file + - linux