File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 22
33.PHONY : all
44all : # # full build
5- all : install build fmt lint test release
5+ all : install generate build mod-tidy fmt lint test release diff
66
77.PHONY : dev
88dev : # # fast build
@@ -18,15 +18,28 @@ install: ## install build tools
1818 $(call print-target)
1919 ./install.sh
2020
21+ .PHONY : generate
22+ generate : # # go generate
23+ $(call print-target)
24+ go generate ./...
25+
2126.PHONY : build
2227build : # # go build
2328 $(call print-target)
2429 go build ./...
2530
31+ .PHONY : mod-tidy
32+ mod-tidy : # # go mod tidy
33+ $(call print-target)
34+ go mod tidy
35+ git diff --exit-code -- go.mod go.sum
36+
2637.PHONY : fmt
2738fmt : # # goimports
2839 $(call print-target)
29- goimports -l -w .
40+ @# ignore the goimports exit code as the generated code may be reformated
41+ goimports -l -w . || true
42+ git diff --exit-code
3043
3144.PHONY : lint
3245lint : # # golangci-lint
@@ -48,6 +61,11 @@ release: ## goreleaser --snapshot --skip-publish --rm-dist
4861 $(call print-target)
4962 goreleaser --snapshot --skip-publish --rm-dist
5063
64+ .PHONY : diff
65+ diff : # # git diff
66+ $(call print-target)
67+ git diff --exit-code
68+
5169.PHONY : docker
5270docker : # # run in golang container, example: make docker run="make all"
5371 docker run --rm -v $(CURDIR ) :/app $(args ) golang:1.14 sh -c " cd /app && $( run) "
You can’t perform that action at this time.
0 commit comments