diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-02 16:49:00 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-02 22:21:07 +0200 |
commit | 35d0797b826727d239eae974a9f2ad425a05a4d6 (patch) | |
tree | 97b171f65819a08601b1773780c39013a46b7025 | |
parent | 75b4a069cb774e63f83539608bbd38a66c98059b (diff) | |
download | qutebrowser-35d0797b826727d239eae974a9f2ad425a05a4d6.tar.gz qutebrowser-35d0797b826727d239eae974a9f2ad425a05a4d6.zip |
ci: Run shellcheck via tox
-rw-r--r-- | scripts/dev/ci/install.sh | 2 | ||||
-rw-r--r-- | scripts/dev/ci/run.sh | 10 | ||||
-rw-r--r-- | scripts/dev/run_shellcheck.sh | 32 | ||||
-rw-r--r-- | tox.ini | 6 |
4 files changed, 39 insertions, 11 deletions
diff --git a/scripts/dev/ci/install.sh b/scripts/dev/ci/install.sh index 2f7f15984..05bbae2c0 100644 --- a/scripts/dev/ci/install.sh +++ b/scripts/dev/ci/install.sh @@ -26,7 +26,7 @@ pip_install() { testenv=$1 -[[ -n $DOCKER || $testenv == shellcheck ]] && exit 0 +[[ -n $DOCKER ]] && exit 0 [[ $testenv == eslint ]] && npm install -g eslint diff --git a/scripts/dev/ci/run.sh b/scripts/dev/ci/run.sh index ff1cdd0d7..2131263af 100644 --- a/scripts/dev/ci/run.sh +++ b/scripts/dev/ci/run.sh @@ -29,16 +29,6 @@ if [[ -n $DOCKER ]]; then -e "DOCKER=$DOCKER" \ -e "CI=$CI" \ "qutebrowser/ci:$DOCKER" -elif [[ $testenv == shellcheck ]]; then - script_list=$(mktemp) - find scripts/dev/ -name '*.sh' > "$script_list" - find misc/userscripts/ -type f -exec grep -lE '[/ ][bd]ash$|[/ ]sh$|[/ ]ksh$' {} + >> "$script_list" - mapfile -t scripts < "$script_list" - rm -f "$script_list" - docker run \ - -v "$PWD:/outside" \ - -w /outside \ - koalaman/shellcheck:stable "${scripts[@]}" else args=() # We only run unit tests on macOS because it's quite slow. diff --git a/scripts/dev/run_shellcheck.sh b/scripts/dev/run_shellcheck.sh new file mode 100644 index 000000000..86c6c2755 --- /dev/null +++ b/scripts/dev/run_shellcheck.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# vim: ft=sh fileencoding=utf-8 sts=4 sw=4 et: + +# Copyright 2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> + +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. + +set -e + +script_list=$(mktemp) +find scripts/dev/ -name '*.sh' > "$script_list" +find misc/userscripts/ -type f -exec grep -lE '[/ ][bd]ash$|[/ ]sh$|[/ ]ksh$' {} + >> "$script_list" +mapfile -t scripts < "$script_list" +rm -f "$script_list" + +docker run \ + -v "$PWD:/outside" \ + -w /outside \ + koalaman/shellcheck:stable "$@" "${scripts[@]}" @@ -187,6 +187,12 @@ whitelist_externals = eslint changedir = {toxinidir}/qutebrowser/javascript commands = eslint --report-unused-disable-directives . +[testenv:shellcheck] +basepython = python3 +deps = +whitelist_externals = bash +commands = bash scripts/dev/run_shellcheck.sh {posargs} + [testenv:mypy] basepython = {env:PYTHON:python3} pip_version = pip |