parent
e60f1202e6
commit
d539b904cc
21
Makefile
21
Makefile
|
@ -1,7 +1,10 @@
|
||||||
.PHONY: all test test-color coverage coverage-cli coverate-html lint format build clean docs
|
.PHONY: all test test-color coverage coverage-cli coverate-html lint format build clean docs
|
||||||
|
|
||||||
all: test-color lint format
|
all:
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
$(MAKE) test-color
|
||||||
|
$(MAKE) lint
|
||||||
|
$(MAKE) format
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -race -failfast ./...
|
go test -race -failfast ./...
|
||||||
|
@ -13,26 +16,30 @@ test-color:
|
||||||
coverage:
|
coverage:
|
||||||
go test -coverprofile=coverage.out ./...
|
go test -coverprofile=coverage.out ./...
|
||||||
|
|
||||||
coverage-cli: coverage
|
coverage-cli:
|
||||||
|
$(MAKE) coverage
|
||||||
go tool cover -func=coverage.out
|
go tool cover -func=coverage.out
|
||||||
|
|
||||||
coverage-html: coverage
|
coverage-html:
|
||||||
|
$(MAKE) coverage
|
||||||
go tool cover -html=coverage.out
|
go tool cover -html=coverage.out
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|
||||||
format:
|
format:
|
||||||
go install github.com/haunt98/gofimports/cmd/gofimports@latest
|
$(MAKE) build
|
||||||
|
# go install github.com/haunt98/gofimports/cmd/gofimports@latest
|
||||||
go install mvdan.cc/gofumpt@latest
|
go install mvdan.cc/gofumpt@latest
|
||||||
gofimports -w -company github.com/make-go-great .
|
./gofimports -w --company github.com/make-go-great,github.com/haunt98 .
|
||||||
gofumpt -w -extra .
|
gofumpt -w -extra .
|
||||||
|
$(MAKE) clean
|
||||||
|
|
||||||
build: clean
|
build:
|
||||||
go build ./cmd/gofimports
|
go build ./cmd/gofimports
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf gofimports
|
rm -rf ./gofimports
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
go install go101.org/golds@latest
|
go install go101.org/golds@latest
|
||||||
|
|
Loading…
Reference in New Issue