Skip to content

Commit

Permalink
fix: make proto-format bug in the Makefile (#438)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zemyblue authored Feb 16, 2022
1 parent fcd999c commit 7947e4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions proto/lbm/tx/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -45,17 +45,17 @@ 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
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
Expand Down

0 comments on commit 7947e4c

Please sign in to comment.