Skip to content

Commit

Permalink
Makefile: add verify-clean and verify-generate targets
Browse files Browse the repository at this point in the history
Use `make verify` to check if someone forgot to run `go generate`
after making changes in errors.go.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Jul 11, 2023
1 parent e43aa38 commit 2f335d6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ all:
CGO_ENABLED=0 $(GO) build -ldflags="-X main.Commit=$$(git describe --tags --abbrev=8 --dirty --always --long)"

.PHONY: verify
verify: verify-space verify-golangci
verify: verify-space verify-generate verify-golangci

.PHONY: verify-golangci
verify-golangci:
Expand All @@ -17,3 +17,12 @@ verify-space: ## Ensure no whitespace at EOL
echo "^^^^ extra whitespace at EOL, please fix"; \
exit 1; \
fi

.PHONY: verify-clean
verify-clean:
git diff --exit-code ## Were the changes committed?

.PHONY: verify-generate
verify-generate: verify-clean
go generate
git diff --exit-code ## Did go generate produced anything new?

0 comments on commit 2f335d6

Please sign in to comment.