Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ linters:
gocritic:
disabled-checks:
- singleCaseSwitch
- deprecatedComment
gocyclo:
min-complexity: 10
govet:
Expand Down
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BUILDX_ACTION ?= --load
TAG_LATEST ?= latest
TAG_ALPINE ?= alpine


ifeq ("$(CI)","true")
LINT_PROCS ?= 1
else
Expand All @@ -36,6 +37,14 @@ GOARM ?= $(subst v,,$(TARGETVARIANT))
endif
endif

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/.bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

GOLANGCI_LINT_VERSION ?= v2.7.2
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint

# platforms := freebsd-amd64 linux-amd64 linux-386 linux-armv5 linux-armv6 linux-armv7 linux-arm64 darwin-amd64 solaris-amd64 windows-amd64.exe windows-386.exe
platforms := freebsd-amd64 linux-amd64 linux-386 linux-armv6 linux-armv7 linux-arm64 linux-ppc64le darwin-amd64 darwin-arm64 solaris-amd64 windows-amd64.exe windows-386.exe

Expand Down Expand Up @@ -184,11 +193,14 @@ docs/content/functions/%.md: docs-src/content/functions/%.yml docs-src/content/f
gomplate.png: gomplate.svg
cloudconvert -f png -c density=288 $^

lint:
@golangci-lint run --verbose --max-same-issues=0 --max-issues-per-linter=0
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION)

ci-lint:
@golangci-lint run --verbose --max-same-issues=0 --max-issues-per-linter=0 --out-format=github-actions
.PHONY: lint
lint: golangci-lint
$(GOLANGCI_LINT) run ./...

.PHONY: gen-changelog clean test build-x build-release build test-integration-docker gen-docs lint clean-images clean-containers docker-images
.DELETE_ON_ERROR:
Expand Down
Loading