diff --git a/hack/gometalinter.sh b/hack/linter.sh similarity index 61% rename from hack/gometalinter.sh rename to hack/linter.sh index ab4a785118..58ef081afd 100755 --- a/hack/gometalinter.sh +++ b/hack/linter.sh @@ -14,22 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. - -#!/bin/bash set -e -o pipefail -SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -install_gometalinter() { - echo "Installing gometalinter.v2" - go get -u gopkg.in/alecthomas/gometalinter.v2 - gometalinter.v2 --install -} +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if ! [ -x "$(command -v gometalinter.v2)" ]; then - install_gometalinter +if ! [ -x "$(command -v golangci-lint)" ]; then + echo "Installing GolangCI-Lint" + ${DIR}/install_golint.sh -b $GOPATH/bin v1.9.3 fi -gometalinter.v2 \ - ${GOMETALINTER_OPTS:--deadine 5m} \ - --config $SCRIPTDIR/gometalinter.json ./... +golangci-lint run \ + --no-config \ + -E goconst \ + -E goimports \ + -E golint \ + -E interfacer \ + -E maligned \ + -E misspell \ + -E unconvert \ + -E unparam \ + -D errcheck diff --git a/test.sh b/test.sh index c332c8f298..c86b974cde 100755 --- a/test.sh +++ b/test.sh @@ -31,7 +31,7 @@ echo "Running validation scripts..." scripts=( "hack/boilerplate.sh" "hack/gofmt.sh" - "hack/gometalinter.sh" + "hack/linter.sh" "hack/dep.sh" ) fail=0