diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..4dc2d94 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,14 @@ +run: + deadline: 120s +linters: + enable: + - govet + # TODO: Not supported by golang-ci - vetshadow + - golint + - ineffassign + - goconst + - deadcode + - gofmt + - goimports + enable-all: false + disable-all: true diff --git a/.travis.yml b/.travis.yml index d1151db..445eb11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ install: - wget -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 - chmod +x dep - mv dep $GOPATH/bin/dep - - go get github.com/alecthomas/gometalinter - - gometalinter --install + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.17.1 script: - ./configure && make test sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 6858187..69d071f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - [#185](https://github.com/pusher/oauth2_proxy/pull/185) Fix an unsupported protocol scheme error during token validation when using the Azure provider (@jonas) - [#141](https://github.com/pusher/oauth2_proxy/pull/141) Check google group membership based on email address (@bchess) - Google Group membership is additionally checked via email address, allowing users outside a GSuite domain to be authorized. +- [#XX](https://github.com/pusher/outh2_proxy/pull/XX) Switch from gometalinter to golangci-lint # v3.2.0 diff --git a/Dockerfile b/Dockerfile index f6649a9..757a1f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM golang:1.12-stretch AS builder # Download tools RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 RUN chmod +x $GOPATH/bin/dep +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 # Copy sources WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 7f011ba..f4bf495 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -3,6 +3,7 @@ FROM golang:1.12-stretch AS builder # Download tools RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 RUN chmod +x $GOPATH/bin/dep +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 # Copy sources WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy diff --git a/Dockerfile.armv6 b/Dockerfile.armv6 index e2c57b9..32bb124 100644 --- a/Dockerfile.armv6 +++ b/Dockerfile.armv6 @@ -3,6 +3,7 @@ FROM golang:1.12-stretch AS builder # Download tools RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 RUN chmod +x $GOPATH/bin/dep +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 # Copy sources WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy diff --git a/Makefile b/Makefile index 720fd4d..3286bda 100644 --- a/Makefile +++ b/Makefile @@ -17,17 +17,7 @@ distclean: clean .PHONY: lint lint: - $(GOMETALINTER) --vendor --disable-all \ - --enable=vet \ - --enable=vetshadow \ - --enable=golint \ - --enable=ineffassign \ - --enable=goconst \ - --enable=deadcode \ - --enable=gofmt \ - --enable=goimports \ - --deadline=120s \ - --tests ./... + $(GOLANGCILINT) run .PHONY: dep dep: diff --git a/configure b/configure index 5d74683..f1b8ae6 100755 --- a/configure +++ b/configure @@ -126,7 +126,7 @@ check_for go check_go_version check_go_env check_for dep -check_for gometalinter +check_for golangci-lint echo @@ -135,7 +135,7 @@ cat <<- EOF > .env GO := "${tools[go]}" GO_VERSION := ${tools[go_version]} DEP := "${tools[dep]}" - GOMETALINTER := "${tools[gometalinter]}" + GOLANGCILINT := "${tools[golangci-lint]}" EOF echo "Environment configuration written to .env"