Skip to content

Commit

Permalink
Merge pull request #71 from bpineau/adopt-golangci-lint
Browse files Browse the repository at this point in the history
Replace gometalinter by golangci-lint
  • Loading branch information
bpineau authored Jan 19, 2019
2 parents 988edd4 + e96cbd9 commit e6353dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
30 changes: 9 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@

all: build

GOLANGCI_VERSION="1.12.5"
tools:
which gometalinter || ( go get -u github.com/alecthomas/gometalinter && gometalinter --install )
which golangci-lint || ( \
curl -sfL "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz" | \
tar xz --strip-components 1 --wildcards '*/golangci-lint' && \
chmod 755 golangci-lint && \
mv golangci-lint ${GOPATH}/bin/ \
)
which glide || go get -u github.com/Masterminds/glide
which goveralls || go get github.com/mattn/goveralls

lint:
gometalinter --concurrency=1 --deadline=300s --vendor --disable-all \
--enable=golint \
--enable=vet \
--enable=vetshadow \
--enable=varcheck \
--enable=errcheck \
--enable=structcheck \
--enable=deadcode \
--enable=ineffassign \
--enable=dupl \
--enable=gotype \
--enable=varcheck \
--enable=interfacer \
--enable=goconst \
--enable=megacheck \
--enable=unparam \
--enable=misspell \
--enable=goimports \
./...
@# vet, errcheck, deadcode, etc are already enabled by default; here we just add more checks:
golangci-lint run -E gofmt,golint,unconvert,dupl,goimports,misspell,maligned

man:
go run assets/manpage.go
Expand Down
4 changes: 3 additions & 1 deletion pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ var (
)

func TestController(t *testing.T) {
flag.Lookup("logtostderr").Value.Set("true")
if err := flag.Lookup("logtostderr").Value.Set("true"); err != nil {
t.Errorf("failed to set logs flags: %v", err)
}

client := fakecontroller.NewFakeControllerSource()

Expand Down

0 comments on commit e6353dd

Please sign in to comment.