-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (22 loc) · 808 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
.PHONY: run test tests fix_lint lint install_tools
run:
@go run .
test: tests
tests:
go test -v -covermode=count -coverpkg github.com/arxeiss/go-expression-calculator/... -coverprofile=coverage.full.out ./...
# Remove cmd package from coverage, see https://dev.to/arxeiss/false-positive-go-code-coverage-3k7j
cat coverage.full.out | grep -v "go-expression-calculator/cmd/" | grep -v "go-expression-calculator/ast/astutils" > coverage.out
rm -f coverage.full.out
coverage: tests
go tool cover -func coverage.out
coverage_browser: tests
go tool cover -html coverage.out
lint:
golangci-lint run ./...
build:
go build -o calculator
fix_lint:
golangci-lint run --fix
install_tools:
@echo Installing tools from tools.go
go list -f '{{range .Imports}}{{.}} {{end}}' tools.go | xargs go install