Merge pull request #1693 from thaJeztah/upgrade_shellcheck_0.6.0

Upgrade shellcheck 0.6.0
This commit is contained in:
Vincent Demeester 2019-03-08 20:58:24 +01:00 committed by GitHub
commit 89dd14d665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 15 deletions

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash
# shellcheck disable=SC2016,SC2119,SC2155
# shellcheck disable=SC2016,SC2119,SC2155,SC2206,SC2207
#
# Shellcheck ignore list:
# - SC2016: Expressions don't expand in single quotes, use double quotes for that.
# - SC2119: Use foo "$@" if function's $1 should mean script's $1.
# - SC2155: Declare and assign separately to avoid masking return values.
# - SC2206: Quote to prevent word splitting, or split robustly with mapfile or read -a.
# - SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#
# You can find more details for each warning at the following page:
# https://github.com/koalaman/shellcheck/wiki/<SCXXXX>

View File

@ -1,10 +1,5 @@
FROM debian:stretch-slim
RUN apt-get update && \
apt-get -y install make shellcheck && \
apt-get clean
FROM koalaman/shellcheck-alpine:v0.6.0
RUN apk add --no-cache bash make
WORKDIR /go/src/github.com/docker/cli
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
CMD bash
COPY . .

View File

@ -7,7 +7,7 @@ set -eu -o pipefail
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/go/src/github.com/docker/cli/scripts/build/.variables
source $SCRIPTDIR/../build/.variables
source "$SCRIPTDIR"/../build/.variables
RESOURCES=$SCRIPTDIR/../winresources
@ -26,9 +26,9 @@ VERSION_QUAD=$(echo -n "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | tr . ,)
# Pass version and commit information into the resource compiler
defs=
[ ! -z "$VERSION" ] && defs+=( "-D DOCKER_VERSION=\"$VERSION\"")
[ ! -z "$VERSION_QUAD" ] && defs+=( "-D DOCKER_VERSION_QUAD=$VERSION_QUAD")
[ ! -z "$GITCOMMIT" ] && defs+=( "-D DOCKER_COMMIT=\"$GITCOMMIT\"")
[ -n "$VERSION" ] && defs+=( "-D DOCKER_VERSION=\"$VERSION\"")
[ -n "$VERSION_QUAD" ] && defs+=( "-D DOCKER_VERSION_QUAD=$VERSION_QUAD")
[ -n "$GITCOMMIT" ] && defs+=( "-D DOCKER_COMMIT=\"$GITCOMMIT\"")
function makeres {
"$WINDRES" \

View File

@ -70,7 +70,7 @@ function runtests {
GOPATH="$GOPATH" \
PATH="$PWD/build/:/usr/bin:/usr/local/bin:/usr/local/go/bin" \
DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-amd64" \
"$(which gotestsum)" -- ./e2e/... ${TESTFLAGS-}
"$(command -v gotestsum)" -- ./e2e/... ${TESTFLAGS-}
}
export unique_id="${E2E_UNIQUE_ID:-cliendtoendsuite}"

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
set -eu
target="${1:-}"
if [[ "$target" != "help" && -z "${DISABLE_WARN_OUTSIDE_CONTAINER:-}" ]]; then
if [ "$target" != "help" ] && [ -z "${DISABLE_WARN_OUTSIDE_CONTAINER:-}" ]; then
(
echo
echo