-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (42 loc) · 1.7 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
SHELL := /usr/bin/env bash
ifeq (, $(shell which go))
$(error "No go in $(PATH)")
endif
.PHONY: build
build:
go build ./...
.PHONY: lint
lint:
@echo "Linting 'go mod tidy'..."
@go mod tidy && \
git diff --exit-code -- go.mod go.sum || \
(echo "'go mod tidy' changed files" && false)
@echo "Linting 'go mod verify'..."
@go mod verify
go run github.com/golangci/golangci-lint/cmd/[email protected] run
go run go.uber.org/nilaway/cmd/[email protected] \
-include-pkgs github.com/jbduncan/go-containers ./...
./scripts/eg_lint.sh
find . -name 'depaware.txt' | \
xargs -n1 dirname | \
xargs go run github.com/tailscale/[email protected] --check
.PHONY: fix
fix:
go mod tidy
go mod download
go run golang.org/x/tools/cmd/[email protected] -t eg/fmt_errorf_to_errors_new.template -w ./...
go run golang.org/x/tools/cmd/[email protected] -t eg/rwmutex_lock_to_rlock.template -w ./...
go run golang.org/x/tools/cmd/[email protected] -t eg/time_now_sub_to_since.template -w ./...
go run github.com/golangci/golangci-lint/cmd/[email protected] run --fix
go run github.com/tailscale/[email protected] ./graph > ./graph/depaware.txt
go run github.com/tailscale/[email protected] ./set > ./set/depaware.txt
go run github.com/tailscale/[email protected] ./set/settest > ./set/settest/depaware.txt
.PHONY: test
test:
go test -shuffle=on -race ./...
.PHONY: check
check: build lint test
.PHONY: update_versions
update_versions:
go get -u -t ./... && go mod tidy && go mod verify && go mod download
@echo "Make sure to update golangci-lint, eg, nilaway and depaware in the Makefile and scripts, too."