ci: Run shellcheck via tox
This commit is contained in:
parent
75b4a069cb
commit
35d0797b82
|
|
@ -26,7 +26,7 @@ pip_install() {
|
|||
|
||||
testenv=$1
|
||||
|
||||
[[ -n $DOCKER || $testenv == shellcheck ]] && exit 0
|
||||
[[ -n $DOCKER ]] && exit 0
|
||||
|
||||
[[ $testenv == eslint ]] && npm install -g eslint
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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[@]}"
|
||||
6
tox.ini
6
tox.ini
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue