From 7947e4c45eb5237620e423308f66dcb1a2bf87e3 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Wed, 16 Feb 2022 13:08:10 +0900 Subject: [PATCH] fix: `make proto-format` bug in the Makefile (#438) * fix: `make proto-format` bug in the Makefile * fix: `make proto-check-breaking` doesn't work. * doc: add changes to CHANGELOG.md * ci: change `make proto-lint` to use clang-format lint --- .github/workflows/proto.yml | 12 +++++++++--- CHANGELOG.md | 1 + Makefile | 11 ++++++----- proto/lbm/tx/v1/service.proto | 8 ++++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index ce15b06e75..832fa81d63 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -7,12 +7,18 @@ on: - "**.proto" jobs: lint: + name: proto-lint(clang-format) runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@master - - name: lint - run: make proto-lint + - uses: actions/checkout@v2 + - uses: DoozyX/clang-format-lint-action@v0.13 + with: + source: '.' + exclude: './third_party' + extensions: 'proto' + clangFormatVersion: 12 + inplace: True # TODO ebony: release comment after merging initial proto files to v2 branch # breakage: # runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index f69e7e8a07..0064c957b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Breaking Changes ### Build, CI +* (makefile, ci) [\#438](https://github.com/line/lbm-sdk/pull/438) fix `make proto-format` and `make proto-check-breaking` error ### Document Updates diff --git a/Makefile b/Makefile index a393615c0b..ee852151d5 100644 --- a/Makefile +++ b/Makefile @@ -420,7 +420,6 @@ containerProtoVer=v0.2 containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer) containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer) containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer) -containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer) proto-all: proto-format proto-lint proto-gen @@ -441,14 +440,16 @@ proto-swagger-gen: proto-format: @echo "Formatting Protobuf files" - @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then $(DOCKER) start -a $(containerProtoFmt); else $(DOCKER) run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ - find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {}; fi + @$(DOCKER) run --rm -v $(CURDIR):/workspace \ + --workdir /workspace tendermintdev/docker-build-proto \ + find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; proto-lint: - @$(DOCKER_BUF) lint --error-format=json + @$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace cellink/clang-format-lint \ + --clang-format-executable /clang-format/clang-format9 -r --extensions proto --exclude ./third_party/* . proto-check-breaking: - @$(DOCKER_BUF) check breaking --against $(HTTPS_GIT)#branch=main + @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint diff --git a/proto/lbm/tx/v1/service.proto b/proto/lbm/tx/v1/service.proto index d1d990d311..faad1a2d3e 100644 --- a/proto/lbm/tx/v1/service.proto +++ b/proto/lbm/tx/v1/service.proto @@ -8,7 +8,7 @@ import "gogoproto/gogo.proto"; import "lbm/base/query/v1/pagination.proto"; option (gogoproto.goproto_registration) = true; -option go_package = "github.com/line/lbm-sdk/types/tx"; +option go_package = "github.com/line/lbm-sdk/types/tx"; // Service defines a gRPC service for interacting with transactions. service Service { @@ -45,7 +45,7 @@ message GetTxsEventRequest { bool prove = 2; // pagination defines an pagination for the request. lbm.base.query.v1.PageRequest pagination = 3; - OrderBy order_by = 4; + OrderBy order_by = 4; } // OrderBy defines the sorting order @@ -53,9 +53,9 @@ enum OrderBy { // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. ORDER_BY_UNSPECIFIED = 0; // ORDER_BY_ASC defines ascending order - ORDER_BY_ASC = 1; + ORDER_BY_ASC = 1; // ORDER_BY_DESC defines descending order - ORDER_BY_DESC = 2; + ORDER_BY_DESC = 2; } // GetTxsEventResponse is the response type for the Service.TxsByEvents