Skip to content

Commit 55630e9

Browse files
Format protofiles using Buf (#143)
* Format protofiles using Buf * Remove comment * Add buf pre-commit hook * Update precommit * Fix workflow * Fix ruff version
1 parent 518f507 commit 55630e9

File tree

98 files changed

+500
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+500
-554
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ repos:
99
args: ["--diff", "betterproto2/src", "betterproto2/tests", "betterproto2_compiler/src", "betterproto2_compiler/tests"]
1010
- id: ruff
1111
args: ["betterproto2/src", "betterproto2/tests", "betterproto2_compiler/src", "betterproto2_compiler/tests"]
12+
13+
- repo: https://github.com/bufbuild/buf
14+
rev: v1.57.2
15+
hooks:
16+
- id: buf-format
17+
files: ^betterproto2_compiler/tests/inputs/.*\.proto$

betterproto2/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dev = [
3131
"mkdocs-material>=9.6.14",
3232
"mkdocstrings[python]>=0.29.1",
3333
"mypy>=1.16.0",
34-
"pre-commit>=4.2.0",
34+
"pre-commit>=4.2.0,<5",
3535
"pyright>=1.1.401",
3636
# The Ruff version is pinned. To update it, also update it in .pre-commit-config.yaml
3737
"ruff==0.9.3",

betterproto2/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

betterproto2_compiler/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protoc-gen-python_betterproto2 = "betterproto2_compiler.plugin:main"
3535

3636
[dependency-groups]
3737
dev = [
38-
"pre-commit>=2.17.0,<3",
38+
"pre-commit>=4.2.0,<5",
3939
"grpcio-tools>=1.54.2,<2",
4040
"poethepoet>=0.32.2,<0.33",
4141
"pyright>=1.1.391,<2",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
syntax = "proto3";
22

3-
import "google/protobuf/any.proto";
4-
53
package any;
64

5+
import "google/protobuf/any.proto";
6+
77
message Person {
8-
string first_name = 1;
9-
string last_name = 2;
8+
string first_name = 1;
9+
string last_name = 2;
1010
}

betterproto2_compiler/tests/inputs/bool/bool.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ syntax = "proto3";
33
package bool;
44

55
message Test {
6-
bool value = 1;
6+
bool value = 1;
77
}

betterproto2_compiler/tests/inputs/bytes/bytes.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ syntax = "proto3";
33
package bytes;
44

55
message Test {
6-
bytes data = 1;
6+
bytes data = 1;
77
}

betterproto2_compiler/tests/inputs/casing/casing.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ message Test {
1515
int32 UPPERCASE = 4;
1616
}
1717

18-
message snake_case_message {
19-
20-
}
18+
message snake_case_message {}

betterproto2_compiler/tests/inputs/casing_inner_class/casing_inner_class.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ message Test {
88
sint32 old_exp = 1;
99
}
1010
inner_class inner = 2;
11-
}
11+
}

betterproto2_compiler/tests/inputs/casing_message_field_uppercase/casing_message_field_uppercase.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ message Test {
66
int32 UPPERCASE = 1;
77
int32 UPPERCASE_V2 = 2;
88
int32 UPPER_CAMEL_CASE = 3;
9-
}
9+
}

0 commit comments

Comments
 (0)