Skip to content

Commit

Permalink
Fixup tags in Makefile and enable the depguard in golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeler committed Jan 17, 2025
1 parent 955ac74 commit 81a6dc1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 18 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

linters:
enable:
- depguard

issues:
exclude-rules:
# Allow usage of deprecated values.
- linters: [ staticcheck ]
text: 'SA1019:'
path: "(pkg/consuldp/bootstrap.go)"
- linters: [staticcheck]
text: "SA1019:"
path: "(pkg/consuldp/bootstrap.go)"

linters-settings:
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: github.com/armon/go-metrics
desc: "use github.com/hashicorp/go-metrics"
- pkg: github.com/hashicorp/go-metrics/compat
desc: "use github.com/hashicorp/go-metrics"
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ PLATFORM = $(OS)/$(ARCH)
DIST = dist/$(PLATFORM)
BIN = $(DIST)/$(BIN_NAME)

GOTAGS=hashicorpmetrics

VERSION = $(shell ./build-scripts/version.sh pkg/version/version.go)
GOLANG_VERSION ?= $(shell head -n 1 .go-version)
BOOTSTRAP_PACKAGE_DIR=internal/bootstrap
Expand Down Expand Up @@ -44,7 +46,7 @@ dist: ## make dist directory and ignore everything

.PHONY: bin
bin: dist ## Build the binary
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="$(GOLDFLAGS)" -o $(BIN) ./cmd/$(BIN_NAME)
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go build -tags="$(GOTAGS)" -trimpath -buildvcs=false -ldflags="$(GOLDFLAGS)" -o $(BIN) ./cmd/$(BIN_NAME)

.PHONY: dev
dev: bin ## Build binary and copy to the destination
Expand Down

0 comments on commit 81a6dc1

Please sign in to comment.