-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckfile
More file actions
18 lines (16 loc) · 1.01 KB
/
Copy pathCheckfile
File metadata and controls
18 lines (16 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -trimpath and -buildvcs=false keep a test binary a function of its
# source alone. Without them a worker's slot path and the commit stamp
# are built in, so a result cached by one slot never counts for
# another and every run starts cold.
test: go test -trimpath -buildvcs=false -race -cover ./...
# goimports rather than gofmt, as in every other repo here: one command
# to remember, and it still holds if this module ever imports something
# of its own. -l lists what it would rewrite, and a non-empty list is
# the failure, since a CI job that rewrote source would have nowhere to
# put it.
lint: out=$(goimports -local "$(go list -m)" -l .); if [ -n "$out" ]; then echo "$out"; exit 1; fi; go vet ./...
# gopls at hint severity is what an editor underlines and nobody
# reading a diff sees. It exits 0 whether or not it found anything, so
# its output is the verdict: awk prints what it read, then fails if it
# read a line.
hints: git ls-files -z '*.go' | xargs -0 gopls check -severity=hint | awk '1; END { exit (NR > 0) }'