Makefile: Check for any non committed auto-generated code (#10579)

Always check if the auto-generated code is still compatible with the
existing written code to avoid a possible forgetting or sometimes a non
intentional change.
This commit is contained in:
Anis Elleuch
2020-09-28 21:33:34 +01:00
committed by GitHub
parent 27d9bd04e5
commit e0c04a2da0
3 changed files with 14 additions and 2 deletions

View File

@@ -18,11 +18,17 @@ getdeps:
@mkdir -p ${GOPATH}/bin
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.27.0)
@which ruleguard 1>/dev/null || (echo "Installing ruleguard" && GO111MODULE=off go get github.com/quasilyte/go-ruleguard/...)
@which msgp 1>/dev/null || (echo "Installing msgp" && go get github.com/tinylib/msgp)
@which stringer 1>/dev/null || (echo "Installing stringer" && go get golang.org/x/tools/cmd/stringer)
crosscompile:
@(env bash $(PWD)/buildscripts/cross-compile.sh)
verifiers: getdeps fmt lint ruleguard
verifiers: getdeps fmt lint ruleguard check-gen
check-gen:
@go generate ./... >/dev/null
@git diff --exit-code >/dev/null || echo "Non-committed changes in auto-generated code are detected, please check."
fmt:
@echo "Running $@ check"