Skip to content

Commit

Permalink
build: replace golint with staticcheck
Browse files Browse the repository at this point in the history
As it has been deprecated for about ~2 years in favor of `go vet` and
tools like `staticcheck`.

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Aug 16, 2023
1 parent ca0e15e commit f85eb01
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

PROJECT := github.com/getsops/sops/v3
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
GO := GOPROXY=https://proxy.golang.org go
GOLINT := golint
PROJECT := github.com/getsops/sops/v3
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
GO := GOPROXY=https://proxy.golang.org go

GITHUB_REPOSITORY ?= github.com/getsops/sops
GITHUB_REPOSITORY ?= github.com/getsops/sops

GORELEASER := $(PROJECT_DIR)/bin/goreleaser
GORELEASER_VERSION ?= v1.20.0
STATICCHECK := $(PROJECT_DIR)/bin/staticcheck
STATICCHECK_VERSION := latest

GORELEASER := $(PROJECT_DIR)/bin/goreleaser
GORELEASER_VERSION ?= v1.20.0

.PHONY: all
all: test vet generate install functional-tests
Expand All @@ -24,8 +26,9 @@ install:
tag: all
git tag -s $(TAGVER) -a -m "$(TAGMSG)"

lint:
$(GOLINT) $(PROJECT)
.PHONY: staticcheck
staticcheck: install-staticcheck
$(STATICCHECK) ./...

.PHONY: vendor
vendor:
Expand Down Expand Up @@ -66,6 +69,10 @@ functional-tests-all:
release-snapshot: install-goreleaser
GITHUB_REPOSITORY=$(GITHUB_REPOSITORY) $(GORELEASER) release --clean --snapshot --skip-sign

.PHONY: install-staticcheck
install-staticcheck:
$(call go-install-tool,$(STATICCHECK),honnef.co/go/tools/cmd/staticcheck@$(STATICCHECK_VERSION),$(STATICCHECK_VERSION))

.PHONY: install-goreleaser
install-goreleaser:
$(call go-install-tool,$(GORELEASER),github.com/goreleaser/goreleaser@$(GORELEASER_VERSION),$(GORELEASER_VERSION))
Expand Down

0 comments on commit f85eb01

Please sign in to comment.