diff --git a/Makefile b/Makefile index 8f78acc80..6d4f40ba4 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,13 @@ ifeq (,$(shell which protoc-gen-gogofaster)) endif .PHONY: check-proto-deps -proto-gen: +check-proto-format-deps: +ifeq (,$(shell which clang-format)) + $(error "clang-format is required for Protobuf formatting. See instructions for your platform on how to install it.") +endif +.PHONY: check-proto-format-deps + +proto-gen: check-proto-deps @echo "Generating Protobuf files" @go run github.com/bufbuild/buf/cmd/buf generate @mv ./proto/tendermint/abci/types.pb.go ./abci/types/ @@ -93,19 +99,11 @@ proto-lint: check-proto-deps @go run github.com/bufbuild/buf/cmd/buf lint .PHONY: proto-lint -proto-format: +proto-format: check-proto-format-deps @echo "Formatting Protobuf files" - docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; + @find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \; .PHONY: proto-format -proto-check-breaking: check-proto-deps - @echo "Checking for breaking changes in Protobuf files against local branch" - @echo "Note: This is only useful if your changes have not yet been committed." - @echo " Otherwise read up on buf's \"breaking\" command usage:" - @echo " https://docs.buf.build/breaking/usage" - @go run github.com/bufbuild/buf/cmd/buf breaking --against ".git" -.PHONY: proto-check-breaking - proto-check-breaking-ci: @go run github.com/bufbuild/buf/cmd/buf breaking --against $(HTTPS_GIT)#branch=v0.34.x .PHONY: proto-check-breaking-ci