From 2cffe9be3d423f2256b4edba50921123363d4b99 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 2 Aug 2019 15:58:33 +0200 Subject: [PATCH] hack: fix mixed tabs/spaces for indentation Signed-off-by: Sebastiaan van Stijn --- hack/generate-swagger-api.sh | 42 ++++++++++++------------- hack/make/.integration-daemon-start | 2 +- hack/make/dynbinary | 7 ++--- hack/make/test-integration-flaky | 24 +++++++------- hack/test/unit | 12 +++---- hack/validate/changelog-date-descending | 4 +-- hack/validate/changelog-well-formed | 16 +++++----- hack/validate/deprecate-integration-cli | 6 ++-- hack/validate/swagger | 4 +-- hack/validate/swagger-gen | 2 +- 10 files changed, 59 insertions(+), 60 deletions(-) diff --git a/hack/generate-swagger-api.sh b/hack/generate-swagger-api.sh index a01a57387a..90a01df027 100755 --- a/hack/generate-swagger-api.sh +++ b/hack/generate-swagger-api.sh @@ -2,26 +2,26 @@ set -eu swagger generate model -f api/swagger.yaml \ - -t api -m types --skip-validator -C api/swagger-gen.yaml \ - -n ErrorResponse \ - -n GraphDriverData \ - -n IdResponse \ - -n ImageDeleteResponseItem \ - -n ImageSummary \ - -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType \ - -n Port \ - -n ServiceUpdateResponse \ - -n Volume + -t api -m types --skip-validator -C api/swagger-gen.yaml \ + -n ErrorResponse \ + -n GraphDriverData \ + -n IdResponse \ + -n ImageDeleteResponseItem \ + -n ImageSummary \ + -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType \ + -n Port \ + -n ServiceUpdateResponse \ + -n Volume swagger generate operation -f api/swagger.yaml \ - -t api -a types -m types -C api/swagger-gen.yaml \ - -T api/templates --skip-responses --skip-parameters --skip-validator \ - -n Authenticate \ - -n ContainerChanges \ - -n ContainerCreate \ - -n ContainerTop \ - -n ContainerUpdate \ - -n ContainerWait \ - -n ImageHistory \ - -n VolumeCreate \ - -n VolumeList + -t api -a types -m types -C api/swagger-gen.yaml \ + -T api/templates --skip-responses --skip-parameters --skip-validator \ + -n Authenticate \ + -n ContainerChanges \ + -n ContainerCreate \ + -n ContainerTop \ + -n ContainerUpdate \ + -n ContainerWait \ + -n ImageHistory \ + -n VolumeCreate \ + -n VolumeList diff --git a/hack/make/.integration-daemon-start b/hack/make/.integration-daemon-start index b1d9255673..34a2c872a6 100644 --- a/hack/make/.integration-daemon-start +++ b/hack/make/.integration-daemon-start @@ -20,7 +20,7 @@ fi # This is a temporary hack for split-binary mode. It can be removed once # https://github.com/docker/docker/pull/22134 is merged into docker master if [ "$(go env GOOS)" = 'windows' ]; then - return + return fi if [ -z "$DOCKER_TEST_HOST" ]; then diff --git a/hack/make/dynbinary b/hack/make/dynbinary index 981e505e9f..2424046e98 100644 --- a/hack/make/dynbinary +++ b/hack/make/dynbinary @@ -3,8 +3,7 @@ set -e # This script exists as backwards compatibility for CI ( - - DEST="${DEST}-daemon" - ABS_DEST="${ABS_DEST}-daemon" - . hack/make/dynbinary-daemon + DEST="${DEST}-daemon" + ABS_DEST="${ABS_DEST}-daemon" + . hack/make/dynbinary-daemon ) diff --git a/hack/make/test-integration-flaky b/hack/make/test-integration-flaky index d718285d8e..a613d6ccbc 100644 --- a/hack/make/test-integration-flaky +++ b/hack/make/test-integration-flaky @@ -3,13 +3,13 @@ set -e -o pipefail source hack/validate/.validate new_tests=$( - validate_diff --diff-filter=ACMR --unified=0 -- 'integration/*_test.go' | - grep -E '^(\+func )(.*)(\*testing)' || true + validate_diff --diff-filter=ACMR --unified=0 -- 'integration/*_test.go' | + grep -E '^(\+func )(.*)(\*testing)' || true ) if [ -z "$new_tests" ]; then - echo 'No new tests added to integration.' - return + echo 'No new tests added to integration.' + return fi echo @@ -18,12 +18,12 @@ echo "$new_tests" echo "Running stress test for them." ( - TESTARRAY=$(echo "$new_tests" | sed 's/+func //' | awk -F'\\(' '{print $1}' | tr '\n' '|') - # Note: TEST_REPEAT will make the test suite run 5 times, restarting the daemon - # and each test will run 5 times in a row under the same daemon. - # This will make a total of 25 runs for each test in TESTARRAY. - export TEST_REPEAT=5 - export TESTFLAGS="-test.count ${TEST_REPEAT} -test.run ${TESTARRAY%?}" - echo "Using test flags: $TESTFLAGS" - source hack/make/test-integration + TESTARRAY=$(echo "$new_tests" | sed 's/+func //' | awk -F'\\(' '{print $1}' | tr '\n' '|') + # Note: TEST_REPEAT will make the test suite run 5 times, restarting the daemon + # and each test will run 5 times in a row under the same daemon. + # This will make a total of 25 runs for each test in TESTARRAY. + export TEST_REPEAT=5 + export TESTFLAGS="-test.count ${TEST_REPEAT} -test.run ${TESTARRAY%?}" + echo "Using test flags: $TESTFLAGS" + source hack/make/test-integration ) diff --git a/hack/test/unit b/hack/test/unit index 656d4982ea..1aea06c54b 100755 --- a/hack/test/unit +++ b/hack/test/unit @@ -20,9 +20,9 @@ pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)") mkdir -p bundles gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- \ - "${BUILDFLAGS[@]}" \ - -cover \ - -coverprofile=bundles/profile.out \ - -covermode=atomic \ - ${TESTFLAGS} \ - ${pkg_list} + "${BUILDFLAGS[@]}" \ + -cover \ + -coverprofile=bundles/profile.out \ + -covermode=atomic \ + ${TESTFLAGS} \ + ${pkg_list} diff --git a/hack/validate/changelog-date-descending b/hack/validate/changelog-date-descending index b9c3368ca6..301f9ba0b5 100755 --- a/hack/validate/changelog-date-descending +++ b/hack/validate/changelog-date-descending @@ -3,8 +3,8 @@ changelogFile=${1:-CHANGELOG.md} if [ ! -r "$changelogFile" ]; then - echo "Unable to read file $changelogFile" >&2 - exit 1 + echo "Unable to read file $changelogFile" >&2 + exit 1 fi grep -e '^## ' "$changelogFile" | awk '{print$3}' | sort -c -r || exit 2 diff --git a/hack/validate/changelog-well-formed b/hack/validate/changelog-well-formed index 6c7ce1a1c0..ea7ef0ff5d 100755 --- a/hack/validate/changelog-well-formed +++ b/hack/validate/changelog-well-formed @@ -3,8 +3,8 @@ changelogFile=${1:-CHANGELOG.md} if [ ! -r "$changelogFile" ]; then - echo "Unable to read file $changelogFile" >&2 - exit 1 + echo "Unable to read file $changelogFile" >&2 + exit 1 fi changelogWellFormed=1 @@ -12,14 +12,14 @@ changelogWellFormed=1 # e.g. "## 1.12.3 (2016-10-26)" VER_LINE_REGEX='^## [0-9]+\.[0-9]+\.[0-9]+(-ce)? \([0-9]+-[0-9]+-[0-9]+\)$' while read -r line; do - if ! [[ "$line" =~ $VER_LINE_REGEX ]]; then - echo "Malformed changelog $changelogFile line \"$line\"" >&2 - changelogWellFormed=0 - fi + if ! [[ "$line" =~ $VER_LINE_REGEX ]]; then + echo "Malformed changelog $changelogFile line \"$line\"" >&2 + changelogWellFormed=0 + fi done < <(grep '^## ' $changelogFile) if [[ "$changelogWellFormed" == "1" ]]; then - echo "Congratulations! Changelog $changelogFile is well-formed." + echo "Congratulations! Changelog $changelogFile is well-formed." else - exit 2 + exit 2 fi diff --git a/hack/validate/deprecate-integration-cli b/hack/validate/deprecate-integration-cli index da6f8310f4..bc20bf9f75 100755 --- a/hack/validate/deprecate-integration-cli +++ b/hack/validate/deprecate-integration-cli @@ -5,13 +5,13 @@ export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPTDIR}/.validate" new_tests=$( - validate_diff --diff-filter=ACMR --unified=0 -- 'integration-cli/*_cli_*.go' | - grep -E '^\+func (.*) Test' || true + validate_diff --diff-filter=ACMR --unified=0 -- 'integration-cli/*_cli_*.go' | + grep -E '^\+func (.*) Test' || true ) if [ -z "$new_tests" ]; then echo 'Congratulations! No new tests added to integration-cli.' - exit + exit fi echo "The following new tests were added to integration-cli:" diff --git a/hack/validate/swagger b/hack/validate/swagger index 0b3c2719d8..29ad75b523 100755 --- a/hack/validate/swagger +++ b/hack/validate/swagger @@ -8,6 +8,6 @@ files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/swagger.yaml' || unset IFS if [ ${#files[@]} -gt 0 ]; then - yamllint -c ${SCRIPTDIR}/.swagger-yamllint api/swagger.yaml - swagger validate api/swagger.yaml + yamllint -c ${SCRIPTDIR}/.swagger-yamllint api/swagger.yaml + swagger validate api/swagger.yaml fi diff --git a/hack/validate/swagger-gen b/hack/validate/swagger-gen index 07c22b5a62..744f627eb4 100755 --- a/hack/validate/swagger-gen +++ b/hack/validate/swagger-gen @@ -25,5 +25,5 @@ if [ ${#files[@]} -gt 0 ]; then echo 'Congratulations! All api changes are done the right way.' fi else - echo 'No api/types/ or api/swagger.yaml changes in diff.' + echo 'No api/types/ or api/swagger.yaml changes in diff.' fi