cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.1.4

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Makefile

48lines · modecode

1PINT_BIN := pint
2PINT_GO_DIRS := cmd internal
3PINT_SRC := $(shell find $(PINT_GO_DIRS) -type f -name '*.go')
4
5GOBIN := $(shell go env GOBIN)
6ifeq ($(GOBIN),)
7GOBIN = $(shell go env GOPATH)/bin
8endif
9
10COVER_DIR = .cover
11COVER_PROFILE = $(COVER_DIR)/coverage.out
12
13.PHONY: build
14build: $(PINT_BIN)
15
16$(PINT_BIN): $(PINT_SRC) go.mod go.sum
17 go build ./cmd/pint
18
19$(GOBIN)/golangci-lint: tools/golangci-lint/go.mod tools/golangci-lint/go.sum
20 go install -modfile=tools/golangci-lint/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint
21.PHONY: lint
22lint: $(GOBIN)/golangci-lint
23 $(GOBIN)/golangci-lint run -E revive,staticcheck,misspell
24
25.PHONY: test
26test:
27 mkdir -p $(COVER_DIR)
28 echo 'mode: atomic' > $(COVER_PROFILE)
29 go test \
30 -covermode=atomic \
31 -coverprofile=$(COVER_PROFILE) \
32 -coverpkg=./... \
33 -race \
34 -count=5 \
35 -timeout=5m \
36 ./...
37
38.PHONY: cover
39cover: test
40 go tool cover -func=$(COVER_PROFILE)
41
42.PHONY: coverhtml
43coverhtml: test
44ifndef CI
45 go tool cover -html=$(COVER_PROFILE)
46else
47 go tool cover -html=$(COVER_PROFILE) -o=.cover/all.html
48endif
49