reusable_git_builds shfmt 2.2.0 vs 2.5.1 normalization

I have shfmt v2.5.1 installed; it disagrees with shfmt v2.2.0 on how to
normalize one line of this file, thus the tests passing. I've manually
edited to what shfmt v2.2.0 apparently desires.

Phil Pennock avatar Phil Pennock

Push event #618 passed

  • Ran for
  • Total time
.travis.yml
language: bash
sudo: false
dist: trusty
os:
- linux
# Disabling, potentially permanently, given ongoing sadness :crying_cat_face:
# - osx
cache:
  directories:
  - "${HOME}/bin"
# Disabling, potentially permanently, given ongoing sadness :crying_cat_face:
# osx_image: xcode7.3
env:
  global:
  - GIMME_TMP="${TRAVIS_BUILD_DIR}/tmp"
  - UNAME="$(uname | tr '[:upper:]' '[:lower:]')"
  - GO_BOOTSTRAP_VERSION=1.8.3
  - GOPATH="${HOME}/gopath"
  - PATH="${HOME}/bin:${PATH}"
  - SHELLCHECK_URL="https://www.googleapis.com/download/storage/v1/b/shellcheck/o/shellcheck-v0.4.7.linux.x86_64.tar.xz?alt=media"
  - SHFMT_URL="https://github.com/mvdan/sh/releases/download/v2.2.0/shfmt_v2.2.0_linux_amd64"
  matrix:
  - TARGET=native GO_VERSIONS="$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) $(sed -n -e '/^[^#]/p' < .testdata/source-$UNAME)"
  - TARGET=arm GO_VERSIONS="master"
  - TARGET=arm64 GO_VERSIONS="$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) master"
addons:
  apt:
    packages:
    # install cross compilers for cgo support.
    - gcc-aarch64-linux-gnu
    - libc6-dev-arm64-cross
before_script:
- mkdir -p "${GIMME_TMP}"
script:
- if [ $UNAME = linux ] && [[ $(shellcheck --version | awk '/^version:/ { print $2 }') != 0.4.7 ]] ; then
    curl -sSL -o "${GIMME_TMP}/shellcheck.tar.xz" "${SHELLCHECK_URL}";
    tar -C "${HOME}/bin" --exclude="*.txt" --strip-components=1 -xf "${GIMME_TMP}/shellcheck.tar.xz";
    shellcheck --version;
  fi
- if [ $UNAME = linux ] && [[ $(shfmt -version 2>/dev/null) != v2.2.0 ]] ; then
    curl -sSL "${SHFMT_URL}" -o "${HOME}/bin/shfmt";
    chmod +x "${HOME}/bin/shfmt";
    shfmt -version;
  fi
- if [ $UNAME = linux ]; then make lint; fi
- git diff --exit-code
- git diff --cached --exit-code
- ./gimme -h
- ./gimme -V
- ./runtests "${TARGET}" "${GO_BOOTSTRAP_VERSION}" ${GO_VERSIONS}
- ./gimme -l
Build Config
{
  "os": [
    "linux"
  ],
  "env": {
    "global": [
      "GIMME_TMP=\"${TRAVIS_BUILD_DIR}/tmp\"",
      "UNAME=\"$(uname | tr '[:upper:]' '[:lower:]')\"",
      "GO_BOOTSTRAP_VERSION=1.8.3",
      "GOPATH=\"${HOME}/gopath\"",
      "PATH=\"${HOME}/bin:${PATH}\"",
      "SHELLCHECK_URL=\"https://www.googleapis.com/download/storage/v1/b/shellcheck/o/shellcheck-v0.4.7.linux.x86_64.tar.xz?alt=media\"",
      "SHFMT_URL=\"https://github.com/mvdan/sh/releases/download/v2.2.0/shfmt_v2.2.0_linux_amd64\""
    ],
    "matrix": [
      "TARGET=native GO_VERSIONS=\"$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) $(sed -n -e '/^[^#]/p' < .testdata/source-$UNAME)\"",
      "TARGET=arm GO_VERSIONS=\"master\"",
      "TARGET=arm64 GO_VERSIONS=\"$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) master\""
    ]
  },
  "dist": "trusty",
  "sudo": false,
  "cache": {
    "directories": [
      "${HOME}/bin"
    ]
  },
  "addons": {
    "apt": {
      "packages": [
        "gcc-aarch64-linux-gnu",
        "libc6-dev-arm64-cross"
      ]
    }
  },
  "script": [
    "if [ $UNAME = linux ] && [[ $(shellcheck --version | awk '/^version:/ { print $2 }') != 0.4.7 ]] ; then curl -sSL -o \"${GIMME_TMP}/shellcheck.tar.xz\" \"${SHELLCHECK_URL}\"; tar -C \"${HOME}/bin\" --exclude=\"*.txt\" --strip-components=1 -xf \"${GIMME_TMP}/shellcheck.tar.xz\"; shellcheck --version; fi",
    "if [ $UNAME = linux ] && [[ $(shfmt -version 2>/dev/null) != v2.2.0 ]] ; then curl -sSL \"${SHFMT_URL}\" -o \"${HOME}/bin/shfmt\"; chmod +x \"${HOME}/bin/shfmt\"; shfmt -version; fi",
    "if [ $UNAME = linux ]; then make lint; fi",
    "git diff --exit-code",
    "git diff --cached --exit-code",
    "./gimme -h",
    "./gimme -V",
    "./runtests \"${TARGET}\" \"${GO_BOOTSTRAP_VERSION}\" ${GO_VERSIONS}",
    "./gimme -l"
  ],
  "language": "shell",
  "before_script": [
    "mkdir -p \"${GIMME_TMP}\""
  ]
}