forked from elves/elvish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.45 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
50
51
52
ELVISH_MAKE_BIN ?= $(or $(GOBIN),$(shell go env GOPATH)/bin)/elvish$(shell go env GOEXE)
ELVISH_MAKE_BIN := $(subst \,/,$(ELVISH_MAKE_BIN))
default: test get
get:
mkdir -p $(shell dirname $(ELVISH_MAKE_BIN))
go build -o $(ELVISH_MAKE_BIN) ./cmd/elvish
generate:
go generate ./...
# Run unit tests, with race detection if the platform supports it.
test:
go test $(shell ./tools/run-race.sh) ./...
cd website; go test $(shell ./tools/run-race.sh) ./...
# Generate a basic test coverage report, and open it in the browser. See also
# https://apps.codecov.io/gh/elves/elvish/.
cover:
go test -coverprofile=cover -coverpkg=./pkg/... ./pkg/...
./tools/prune-cover.sh .codecov.yml cover
go tool cover -html=cover
go tool cover -func=cover | tail -1 | awk '{ print "Overall coverage:", $$NF }'
# Ensure the style of Go and Markdown source files is consistent.
style:
find . -name '*.go' | xargs goimports -w
find . -name '*.go' | xargs gofmt -s -w
find . -name '*.md' | xargs prettier --write
# Check if the style of the Go and Markdown files is correct without modifying
# those files.
checkstyle: checkstyle-go checkstyle-md
checkstyle-go:
./tools/checkstyle-go.sh
checkstyle-md:
./tools/checkstyle-md.sh
lint:
./tools/lint.sh
codespell:
codespell --skip .git
check-content:
./tools/check-content.sh
.SILENT: checkstyle-go checkstyle-md lint
.PHONY: default get generate test cover style checkstyle checkstyle-go checkstyle-md lint codespell check-content