2022-05-03 20:03:37 +00:00
|
|
|
# renovate: datasource=github-releases depName=mvdan/gofumpt
|
2023-04-10 00:53:18 +00:00
|
|
|
GOFUMPT_PACKAGE_VERSION := v0.5.0
|
2022-05-03 20:03:37 +00:00
|
|
|
# renovate: datasource=github-releases depName=golangci/golangci-lint
|
2023-11-06 01:04:15 +00:00
|
|
|
GOLANGCI_LINT_PACKAGE_VERSION := v1.55.2
|
2022-05-03 20:03:37 +00:00
|
|
|
|
|
|
|
GO ?= go
|
|
|
|
PACKAGES ?= $(shell go list ./...)
|
|
|
|
SOURCES ?= $(shell find . -name "*.go" -type f)
|
|
|
|
|
|
|
|
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@$(GOFUMPT_PACKAGE_VERSION)
|
|
|
|
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_PACKAGE_VERSION)
|
2023-10-29 15:03:59 +00:00
|
|
|
GOTESTSUM_PACKAGE ?= gotest.tools/gotestsum@latest
|
2022-05-03 20:03:37 +00:00
|
|
|
|
|
|
|
GENERATE ?=
|
|
|
|
|
|
|
|
.PHONY: fmt
|
|
|
|
fmt:
|
|
|
|
$(GO) run $(GOFUMPT_PACKAGE) -extra -w $(SOURCES)
|
|
|
|
|
|
|
|
.PHONY: golangci-lint
|
|
|
|
golangci-lint:
|
|
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint: golangci-lint
|
|
|
|
|
|
|
|
.PHONY: generate
|
|
|
|
generate:
|
|
|
|
$(GO) generate $(GENERATE)
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2023-10-29 15:03:59 +00:00
|
|
|
$(GO) run $(GOTESTSUM_PACKAGE) --no-color=false -- -coverprofile=coverage.out $(PACKAGES)
|
2022-05-03 20:03:37 +00:00
|
|
|
|
|
|
|
.PHONY: deps
|
|
|
|
deps:
|
|
|
|
$(GO) mod download
|
|
|
|
$(GO) install $(GOFUMPT_PACKAGE)
|
|
|
|
$(GO) install $(GOLANGCI_LINT_PACKAGE)
|
2023-10-29 15:03:59 +00:00
|
|
|
$(GO) install $(GOTESTSUM_PACKAGE)
|