-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 876 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 876 Bytes
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
# make formats, tests, and validates
DOLLAR=$
all:
git status | awk '/modified:/{print ${DOLLAR}NF}' | perl -n -e 'print if /\.go${DOLLAR}/' | xargs -r gofmt -w -s
go mod tidy
go test ./...
golangci-lint run
@ echo any output from the following command indicates an out-of-date direct dependency
go list -u -m -f '{{if (and (not .Indirect) .Update)}}{{.}}{{end}}' all
misspell:;
go install github.com/client9/misspell/cmd/misspell@latest
misspell -w `find . -name \*.md`
calculate_coverage:
echo "mode: atomic" > coverage.txt
for d in $$(go list ./...); do \
go test -race -covermode=atomic -coverprofile=profile.out -coverpkg=github.com/singlestore-labs/events/... $$d; \
if [ -f profile.out ]; then \
grep -v ^mode profile.out >> coverage.txt; \
rm profile.out; \
fi; \
done
coverage: calculate_coverage
go tool cover -html=coverage.txt