mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 22:23:11 +00:00
This pull request aims to make it possible to generate, format, and lint the protos within this repo. To accomplish that end, the Dockerfile containing common tools for building the tendermint protos has been moved into this repository and several accompanying changes were made to streamline the proto generation process.
32 lines
1.1 KiB
Makefile
32 lines
1.1 KiB
Makefile
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto
|
|
HTTPS_GIT := https://github.com/tendermint/spec.git
|
|
|
|
###############################################################################
|
|
### Protobuf ###
|
|
###############################################################################
|
|
|
|
proto-all: proto-lint proto-check-breaking
|
|
.PHONY: proto-all
|
|
|
|
proto-gen:
|
|
@echo "Generating Protobuf files"
|
|
@$(DOCKER_PROTO_BUILDER) buf generate --template=./buf.gen.yaml --config ./buf.yaml
|
|
.PHONY: proto-gen
|
|
|
|
proto-lint:
|
|
@$(DOCKER_PROTO_BUILDER) buf lint --error-format=json --config ./buf.yaml
|
|
.PHONY: proto-lint
|
|
|
|
proto-format:
|
|
@echo "Formatting Protobuf files"
|
|
@$(DOCKER_PROTO_BUILDER) find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
|
|
.PHONY: proto-format
|
|
|
|
proto-check-breaking:
|
|
@$(DOCKER_PROTO_BUILDER) buf breaking --against .git --config ./buf.yaml
|
|
.PHONY: proto-check-breaking
|
|
|
|
proto-check-breaking-ci:
|
|
@$(DOCKER_PROTO_BUILDER) buf breaking --against $(HTTPS_GIT) --config ./buf.yaml
|
|
.PHONY: proto-check-breaking-ci
|