Skip to content

Commit

Permalink
Add golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: kouki <[email protected]>
  • Loading branch information
kmdkuk committed Nov 19, 2023
1 parent a9ded6d commit 48636ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ test: lint ## Run lint & test.
go test ./...

.PHONY: lint
lint: staticcheck ## Run lint
lint: staticcheck golangci-lint ## Run lint
test -z "$$(gofmt -s -l . | tee /dev/stderr)"
$(STATICCHECK) ./...
$(GOLANGCI_LINT) run
go vet ./...

##@ Documentations
Expand Down Expand Up @@ -93,3 +94,11 @@ staticcheck: $(STATICCHECK)
$(STATICCHECK):
mkdir -p $(BIN_DIR)
GOBIN=$(BIN_DIR) go install honnef.co/go/tools/cmd/staticcheck@latest

GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}

0 comments on commit 48636ed

Please sign in to comment.