From 1fc16cb2ebe61eb67f86643642663ca7b33cad00 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Fri, 18 Sep 2015 10:15:02 -0700 Subject: [PATCH] Fix clang-format on Travis Summary: Commit 1b598213aade733c5efd0ec747bf559cde442674 does not quite work as intended. This patch fixes Travis by adding clang-format to the packages list and excluding clang-format from the OSX build. In addition the build does not stop when bad formatting is detected but the build still fails. Test Plan: See https://travis-ci.org/facebook/rocksdb/builds/81037125 Reviewers: igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D47223 --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0734177bc..2dfc0627b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ matrix: addons: apt: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] - packages: ['clang-3.6', 'zlib1g-dev', 'libbz2-dev', 'libsnappy-dev', 'curl'] + packages: ['clang-3.6', 'clang-format-3.6', 'zlib1g-dev', 'libbz2-dev', 'libsnappy-dev', 'curl'] - os: osx compiler: clang @@ -27,12 +27,14 @@ before_script: - export LIBRARY_PATH="$LIBRARY_PATH:/tmp/gflags-2.1.2/lib" - export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/tmp/gflags-2.1.2/include" - if [ -n "${COMPILER}" ]; then CXX=${COMPILER}; fi - - if [[ $(uname -s) == 'Darwin' ]]; then brew install gflags snappy; fi + - if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then brew install gflags snappy; fi - ulimit -n 2000 || true # Lousy hack to disable use and testing of fallocate, which doesn't behave quite # as EnvPosixTest::AllocateTest expects within the Travis OpenVZ environment. -script: OPT=-DTRAVIS CLANG_FORMAT_DIFF=/tmp/clang-format-diff.py make format && OPT=-DTRAVIS V=1 make -j4 check && OPT=-DTRAVIS V=1 make clean jclean rocksdbjava jtest +script: + - if [[ "${TRAVIS_OS_NAME}" == 'linux' ]]; then OPT=-DTRAVIS CLANG_FORMAT_DIFF=/tmp/clang-format-diff.py make format; fi + - OPT=-DTRAVIS V=1 make -j4 check && OPT=-DTRAVIS V=1 make clean jclean rocksdbjava jtest notifications: email: