From 9830f4ef4872913e6ade21d90f61d5db9fd874b7 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sat, 27 Aug 2016 13:45:18 +0200 Subject: [PATCH] Check rustfmt formatting in travis builds (#210) * Install rustfmt * Check formatting in travis builds --- .travis.yml | 2 ++ scripts/travis-build.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6a52a861..8babf544 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ rust: cache: cargo +before_script: (cargo install rustfmt || true) + sudo: false notifications: diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh index 1135ed96..cfa528ad 100644 --- a/scripts/travis-build.sh +++ b/scripts/travis-build.sh @@ -5,6 +5,10 @@ set -e # build rust project make +# check formatting (rustfmt) +PATH=~/.cargo/bin:$PATH +cargo fmt -- --write-mode=diff + # clone hugo branch, which contains the blog template git clone --branch=hugo https://github.com/phil-opp/blog_os.git hugo cd hugo