Skip to content

Commit 980ea3c

Browse files
authored
Add format github action for proto files (#57)
This PR establishes that we should use the Google style of formatting for proto3 files, with line-end breaks happening at 120 characters (a decent line ending break in the era of 1080p and 4k). It also installs a github action that will enforce the formatting and throw when things are not formatted @devs: to get the right formatting on your PRs you can do the following - add to your visual studio settings.json: ```json "clang-format.style": "{BasedOnStyle: Google, ColumnLimit: 120}" ``` to run one massive format run on everything you can do: ```bash find . -name "*.proto" | xargs clang-format -i --style="file:./.clang-format ```
1 parent c2ed728 commit 980ea3c

File tree

15 files changed

+288
-300
lines changed

15 files changed

+288
-300
lines changed

.clang-format

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Language: Proto
3+
BasedOnStyle: Google
4+
ColumnLimit: 120
5+
---

.github/workflows/protofmt.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: clang-format proto Check
2+
on: [pull_request]
3+
jobs:
4+
formatting-check:
5+
name: Formatting Check
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- name: Run clang-format style check for C/C++/Protobuf programs.
10+
uses: jidicula/[email protected]
11+
with:
12+
clang-format-version: '17'
13+
include-regex: '^.*\.proto$'
14+

x/emissions/api/v1/query.pulsar.go

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/emissions/api/v1/tx.pulsar.go

+9-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/emissions/api/v1/types.pulsar.go

+9-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/emissions/proto/emissions/state/module/v1/module.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
88
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
99
message Module {
1010
option (cosmos.app.v1alpha1.module) = {
11-
go_import : "github.com/allora-network/allora-chain/x/emissions"
11+
go_import: "github.com/allora-network/allora-chain/x/emissions"
1212
};
1313
}

0 commit comments

Comments
 (0)