Skip to content

Commit

Permalink
makefile: start treating vet as a check
Browse files Browse the repository at this point in the history
This adds vet as a check in `make check`. Additionally, it moves
the run of vet in `make test` and `make manager` to after the build.
I wanted to remove it entirely from that line but decided not to make
such a big change. Vet needs to run after compile because it prints
a 'vet: ' prefix on compile errors [1], and this messes up tools -
specifically my vim quickfix. Doing the build first makes you fix
real compiler errors and then real vet errors found afterward get
emitted without the annoying prefix.

[1]: golang/go#34142

Signed-off-by: John Mulligan <jmulligan@redhat.com>
  • Loading branch information
phlogistonjohn committed Jun 12, 2021
1 parent a25e7b8 commit e66ad5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ endif
all: manager build-integration-tests

# Run tests
test: generate vet manifests
test: generate manifests vet
hack/test.sh

# Build manager binary
manager: generate vet build
manager: generate build vet

build:
go build -o bin/manager -ldflags "-X main.Version=$(GIT_VERSION) -X main.CommitID=$(COMMIT_ID)" main.go
Expand Down Expand Up @@ -170,7 +170,7 @@ bundle-build:

.PHONY: check check-revive check-format

check: check-revive check-format
check: check-revive check-format vet

check-format:
! gofmt $(CHECK_GOFMT_FLAGS) . | sed 's,^,formatting error: ,' | grep 'go$$'
Expand Down

0 comments on commit e66ad5a

Please sign in to comment.