You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB

  1. # The Docker image containing the generator, formatter, and linter.
  2. # This is generated by proto/Dockerfile. To update tools, make changes
  3. # there and run the Build & Push Proto Builder Image workflow.
  4. IMAGE := ghcr.io/tendermint/docker-build-proto:latest
  5. DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(IMAGE)
  6. HTTPS_GIT := https://github.com/tendermint/spec.git
  7. ###############################################################################
  8. ### Protobuf ###
  9. ###############################################################################
  10. proto-all: proto-lint proto-check-breaking
  11. .PHONY: proto-all
  12. proto-gen:
  13. @echo "Generating Protobuf files"
  14. @$(DOCKER_PROTO_BUILDER) buf generate --template=./buf.gen.yaml --config ./buf.yaml
  15. .PHONY: proto-gen
  16. proto-lint:
  17. @$(DOCKER_PROTO_BUILDER) buf lint --error-format=json --config ./buf.yaml
  18. .PHONY: proto-lint
  19. proto-format:
  20. @echo "Formatting Protobuf files"
  21. @$(DOCKER_PROTO_BUILDER) find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
  22. .PHONY: proto-format
  23. proto-check-breaking:
  24. @$(DOCKER_PROTO_BUILDER) buf breaking --against .git --config ./buf.yaml
  25. .PHONY: proto-check-breaking
  26. proto-check-breaking-ci:
  27. @$(DOCKER_PROTO_BUILDER) buf breaking --against $(HTTPS_GIT) --config ./buf.yaml
  28. .PHONY: proto-check-breaking-ci