diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 5d63ff6e6b..4e09dd5842 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -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/ diff --git a/dockerfiles/Dockerfile.shellcheck b/dockerfiles/Dockerfile.shellcheck index 2507062ee9..dd3cab79b2 100644 --- a/dockerfiles/Dockerfile.shellcheck +++ b/dockerfiles/Dockerfile.shellcheck @@ -1,7 +1,5 @@ -FROM koalaman/shellcheck-alpine:v0.4.6 +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 -ENTRYPOINT [""] -CMD ["/bin/sh"] COPY . . diff --git a/scripts/gen/windows-resources b/scripts/gen/windows-resources index 14b45e08e0..5fdc1b4ade 100755 --- a/scripts/gen/windows-resources +++ b/scripts/gen/windows-resources @@ -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" \ diff --git a/scripts/test/e2e/run b/scripts/test/e2e/run index bdff2ce3e3..51dc24ff17 100755 --- a/scripts/test/e2e/run +++ b/scripts/test/e2e/run @@ -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}"