build: fix make fmt, reformat test sources (#234)

This commit is contained in:
Daniel Moran
2021-08-20 15:26:00 -04:00
committed by GitHub
parent 3a6dfe7102
commit c0103e7b1b
5 changed files with 39 additions and 36 deletions

View File

@ -14,8 +14,11 @@ ifdef COMMIT
endif
export GO_BUILD=go build -ldflags "$(LDFLAGS)"
# SOURCES are the files that affect building the main binary.
SOURCES := $(shell find . -name '*.go' -not -name '*_test.go') go.mod go.sum
SOURCES_NO_VENDOR := $(shell find . -path ./vendor -prune -o -name "*.go" -not -name '*_test.go' -print)
# FMT_FILES are all files that should be formatted according to our rules.
FMT_FILES := $(shell find . -path ./vendor -prune -o -name "*.go" -print)
# Allow for `go test` to be swapped out by other tooling, i.e. `gotestsum`
export GO_TEST=go test
@ -26,7 +29,7 @@ GO_TEST_PATHS=./...
openapi:
./etc/generate-openapi.sh
fmt: $(SOURCES_NO_VENDOR)
fmt: $(FMT_FILES)
# Format everything, but the import-format doesn't match our desired pattern.
gofmt -w -s $^
# Remove unused imports.