Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make proto-format bug in the Makefile #438

Merged
merged 5 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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