-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
49 lines (33 loc) · 931 Bytes
/
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
MODULES=$(shell find . -mindepth 2 -maxdepth 4 -type f -name 'go.mod' | cut -c 3- | sed 's|/[^/]*$$||' | sort -u | tr / :)
build:
$(MAKE) $(addprefix build-, $(MODULES))
build-%:
cd $(subst :,/,$*); go build .
tidy:
$(MAKE) $(addprefix tidy-, $(MODULES))
tidy-%:
cd $(subst :,/,$*); go mod tidy
fmt:
$(MAKE) $(addprefix fmt-, $(MODULES))
fmt-%:
cd $(subst :,/,$*); go fmt ./...
check-fmt:
$(MAKE) $(addprefix check-fmt-, $(MODULES))
check-fmt-%:
cd $(subst :,/,$*); test -z "$$(gofmt -l .)"
vet:
$(MAKE) $(addprefix vet-, $(MODULES))
vet-%:
cd $(subst :,/,$*); go vet ./... ;\
test:
$(MAKE) $(addprefix test-, $(MODULES))
test-%:
cd $(subst :,/,$*); go test ./... -coverprofile cover.out ;
lint:
revive -config revive.toml ./...
scan:
$(MAKE) $(addprefix scan-, $(MODULES))
scan-%:
cd $(subst :,/,$*); syft scan . -o json | grype --fail-on low
check-go-version-consistency:
hack/check_go_version.sh