-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
49 lines (38 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Put tools at the root of the folder.
PATH := $(CURDIR)/.tools/bin:$(PATH)
.PHONY: clean
clean:
@# go mod makes the modules read-only, so before deletion we need to make them deleteable
@chmod -R u+rwX .tools 2> /dev/null || true
rm -rf .tools/
.PHONY: test
test:
go test -tags netgo -timeout 30m -race -count 1 ./...
.PHONY: lint
lint: .tools/bin/misspell .tools/bin/faillint .tools/bin/golangci-lint
misspell -error README.md CONTRIBUTING.md LICENSE
# Configured via .golangci.yml.
golangci-lint run
.PHONY: mod-check
mod-check:
GO111MODULE=on go mod download
GO111MODULE=on go mod verify
GO111MODULE=on go mod tidy
@git diff --exit-code -- go.sum go.mod
.PHONY: drone
drone: .drone/drone.yml
# Drone.
.drone/drone.yml: .drone/drone.jsonnet
drone jsonnet --source $< --target [email protected] --stream --format=false
drone sign --save grafana/alerting [email protected]
drone lint --trusted [email protected]
mv [email protected] $@
# Tools needed to run linting.
.tools:
mkdir -p .tools/
.tools/bin/misspell: .tools
GOPATH=$(CURDIR)/.tools go install github.com/client9/misspell/cmd/[email protected]
.tools/bin/faillint: .tools
GOPATH=$(CURDIR)/.tools go install github.com/fatih/[email protected]
.tools/bin/golangci-lint: .tools
GOPATH=$(CURDIR)/.tools go install github.com/golangci/golangci-lint/cmd/[email protected]