From b91a39be220c86fa2659e6cfa73b16c54a8686f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chavant?= Date: Sat, 2 Dec 2017 19:22:14 +0100 Subject: [PATCH] Run shellcheck on Travis CI --- .travis.yml | 3 +++ scripts/dev/ci/travis_run.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index 65d917d73..37387b620 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,9 @@ matrix: language: node_js python: null node_js: "lts/*" + - os: linux + env: TESTENV=shellcheck + services: docker fast_finish: true cache: diff --git a/scripts/dev/ci/travis_run.sh b/scripts/dev/ci/travis_run.sh index 2a5424fb9..70c41b0c3 100644 --- a/scripts/dev/ci/travis_run.sh +++ b/scripts/dev/ci/travis_run.sh @@ -14,6 +14,16 @@ elif [[ $TESTENV == eslint ]]; then # travis env cd qutebrowser/javascript || exit 1 eslint --color --report-unused-disable-directives . +elif [[ $TESTENV == shellcheck ]]; then + dev_scripts=$( find scripts/dev/ -name '*.sh' -print0 | xargs -0 ) + # false positive: we are using 'find -exec +' + # shellcheck disable=SC2038 + userscripts=$( find misc/userscripts/ -type f -exec grep -lE '[/ ][bd]ash$|[/ ]sh$|[/ ]ksh$' {} + | xargs ) + IFS=" " read -r -a scripts <<< "$dev_scripts $userscripts" + docker run \ + -v "$PWD:/outside" \ + -w /outside \ + koalaman/shellcheck:stable "${scripts[@]}" else args=() [[ $TRAVIS_OS_NAME == osx ]] && args=('--qute-bdd-webengine' '--no-xvfb')