Apache DataFusion SQL Query Engine
ARROW-1578: [C++] Run lint checks in Travis CI much earlier at before_script stage to fail faster
Wes McKinney70effbc460c3
diff --git a/.travis.yml b/.travis.ymlindex f6f64003d2..4691eeb065 100644--- a/.travis.yml+++ b/.travis.yml@@ -40,8 +40,6 @@ services:cache:ccache: true- directories:- - $HOME/.conda_packagesmatrix:fast_finish: true@@ -58,6 +56,7 @@ matrix:- export ARROW_TRAVIS_USE_TOOLCHAIN=1- export ARROW_TRAVIS_VALGRIND=1- export ARROW_TRAVIS_PLASMA=1+ - $TRAVIS_BUILD_DIR/ci/travis_lint.sh- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.shscript:- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh@@ -65,6 +64,7 @@ matrix:- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 2.7- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 3.6- compiler: clang+ language: cpposx_image: xcode6.4os: osxcache:@@ -106,6 +106,7 @@ matrix:- source $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh- export CC="clang-4.0"- export CXX="clang++-4.0"+ - $TRAVIS_BUILD_DIR/ci/travis_lint.sh- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.shscript:- $TRAVIS_BUILD_DIR/ci/travis_script_integration.sh@@ -123,6 +124,7 @@ matrix:before_script:- export CC="gcc-4.9"- export CXX="g++-4.9"+ - $TRAVIS_BUILD_DIR/ci/travis_lint.sh- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library- $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.shscript:diff --git a/ci/travis_before_script_cpp.sh b/ci/travis_before_script_cpp.shindex d46fa2ff94..a7f1d27563 100755--- a/ci/travis_before_script_cpp.sh+++ b/ci/travis_before_script_cpp.sh@@ -99,6 +99,7 @@ else$ARROW_CPP_DIRfi+# Build and install libraries$TRAVIS_MAKE -j4$TRAVIS_MAKE installdiff --git a/ci/travis_lint.sh b/ci/travis_lint.shnew file mode 100755index 0000000000..9b7b474524--- /dev/null+++ b/ci/travis_lint.sh@@ -0,0 +1,40 @@+#!/usr/bin/env bash++# Licensed to the Apache Software Foundation (ASF) under one+# or more contributor license agreements. See the NOTICE file+# distributed with this work for additional information+# regarding copyright ownership. The ASF licenses this file+# to you under the Apache License, Version 2.0 (the+# "License"); you may not use this file except in compliance+# with the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing,+# software distributed under the License is distributed on an+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+# KIND, either express or implied. See the License for the+# specific language governing permissions and limitations+# under the License.++set -ex++# Fail fast for code linting issues+mkdir $TRAVIS_BUILD_DIR/cpp/lint+pushd $TRAVIS_BUILD_DIR/cpp/lint++cmake ..+make lint++popd++# Fail fast on style checks+sudo pip install flake8++PYARROW_DIR=$TRAVIS_BUILD_DIR/python++flake8 --count $PYTHON_DIR/pyarrow++# Check Cython files with some checks turned off+flake8 --count --config=$PYTHON_DIR/.flake8.cython \+ $PYTHON_DIR/pyarrowdiff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.shindex 4e3e7bbea1..a2079036c4 100755--- a/ci/travis_script_cpp.sh+++ b/ci/travis_script_cpp.sh@@ -27,8 +27,6 @@ git archive HEAD --prefix=apache-arrow/ --output=arrow-src.tar.gzpushd $CPP_BUILD_DIR-$TRAVIS_MAKE lint-# ARROW-209: checks depending on the LLVM toolchain are disabled temporarily# until we are able to install the full LLVM toolchain in Travis CI againdiff --git a/ci/travis_script_python.sh b/ci/travis_script_python.shindex e2cf254934..f6ce18a2ab 100755--- a/ci/travis_script_python.sh+++ b/ci/travis_script_python.sh@@ -38,7 +38,7 @@ which pythonconda install -y -q nomkl# Expensive dependencies install from Continuum package repo-conda install -y -q pip numpy pandas cython flake8+conda install -y -q pip numpy pandas cython# Build C++ librariespushd $ARROW_CPP_BUILD_DIR@@ -62,12 +62,6 @@ popd# Other stuff pip installpushd $ARROW_PYTHON_DIR-# Fail fast on style checks-flake8 --count pyarrow--# Check Cython files with some checks turned off-flake8 --count --config=.flake8.cython pyarrow-pip install -r requirements.txtpython setup.py build_ext --with-parquet --with-plasma \install --single-version-externally-managed --record=record.text