go-json/Makefile

29 lines
599 B
Makefile
Raw Permalink Normal View History

2021-02-03 17:33:28 +03:00
BIN_DIR := $(CURDIR)/bin
$(BIN_DIR):
@mkdir -p $(BIN_DIR)
2021-01-16 16:16:26 +03:00
.PHONY: cover
cover:
@ go test -coverprofile=cover.tmp.out . ; \
cat cover.tmp.out | grep -v "encode_optype.go" > cover.out; \
rm cover.tmp.out
2021-01-16 16:18:44 +03:00
.PHONY: cover-html
2021-01-16 16:16:26 +03:00
cover-html: cover
go tool cover -html=cover.out
2021-02-03 17:33:28 +03:00
.PHONY: lint
lint: golangci-lint
golangci-lint run
golangci-lint: | $(BIN_DIR)
2021-02-03 17:43:14 +03:00
@{ \
set -e; \
GOLANGCI_LINT_TMP_DIR=$$(mktemp -d); \
cd $$GOLANGCI_LINT_TMP_DIR; \
go mod init tmp; \
GOBIN=$(BIN_DIR) go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.36.0; \
rm -rf $$GOLANGCI_LINT_TMP_DIR; \
}