gometalinter -> golangci-lint migration (#3933)
{,scripts/}Makefile:
- Remove gometalinter, install golangci-lint.
- Remove distinction between tools and devtools.
Just tools is enough.
- test_lint -> lint
Migrating away from underscore separated names.
- Remove unnecessary targets.
- Drop tendermint/lint. Incompatbile with golangci-lint
and no longer necessary anyway.
- Fix misleading message in go-mod-cache.
- New ci-target to avoid download tools twice.
- Run tests with -mod=readonly.
Port tools/gometalinter.json to .golangci.yml
Update CircleCI config accordingly.
Closes: #3896
This commit is contained in:
+21
-10
@@ -17,6 +17,8 @@ endif
|
||||
|
||||
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||
GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com
|
||||
GOLANGCI_LINT_VERSION := v1.15.0
|
||||
GOLANGCI_LINT_HASHSUM := ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
|
||||
|
||||
###
|
||||
# Functions
|
||||
@@ -33,26 +35,35 @@ cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3)
|
||||
|
||||
go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && $(GO) install
|
||||
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd)
|
||||
|
||||
###
|
||||
# tools
|
||||
###
|
||||
all: tools
|
||||
tools: $(GOPATH)/bin/gometalinter $(GOPATH)/bin/statik $(GOPATH)/bin/goimports $(GOPATH)/bin/gosum
|
||||
|
||||
#v2.0.11
|
||||
$(GOPATH)/bin/gometalinter:
|
||||
$(call go_install,alecthomas,gometalinter,v3.0.0)
|
||||
tools: tools-stamp
|
||||
tools-stamp: $(GOBIN)/golangci-lint $(GOBIN)/statik $(GOBIN)/goimports $(GOBIN)/gosum $(GOBIN)/sdkch
|
||||
touch $@
|
||||
|
||||
$(GOPATH)/bin/statik:
|
||||
$(GOBIN)/golangci-lint: contrib/install-golangci-lint.sh $(GOBIN)/gosum
|
||||
bash contrib/install-golangci-lint.sh $(GOBIN) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM)
|
||||
|
||||
$(GOBIN)/statik:
|
||||
$(call go_install,rakyll,statik,v0.1.5)
|
||||
|
||||
$(GOPATH)/bin/goimports:
|
||||
$(GOBIN)/goimports:
|
||||
go get golang.org/x/tools/cmd/goimports@v0.0.0-20190114222345-bf090417da8b
|
||||
|
||||
$(GOPATH)/bin/gosum:
|
||||
go install ./cmd/gosum/
|
||||
$(GOBIN)/gosum:
|
||||
go install -mod=readonly ./cmd/gosum/
|
||||
|
||||
$(GOBIN)/sdkch:
|
||||
go install -mod=readonly ./cmd/sdkch/
|
||||
|
||||
tools-clean:
|
||||
cd $(GOPATH)/bin && rm -f gometalinter statik goimports gosum
|
||||
cd $(GOBIN) && rm -f golangci-lint statik goimports gosum sdkch
|
||||
rm -f tools-stamp
|
||||
|
||||
.PHONY: all tools-clean
|
||||
.PHONY: all tools tools-clean
|
||||
|
||||
Reference in New Issue
Block a user