Skip to content

Commit 0f7d000

Browse files
committed
Generate visitors during proto generation
1 parent c2714d8 commit 0f7d000

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/gen_protos_docker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@
2424
check=True,
2525
)
2626
subprocess.run(["uv", "run", "poe", "format"], check=True)
27+
28+
subprocess.run(["uv", "run", f"{os.getcwd()}/scripts/gen_visitors.py"], check=True)

scripts/gen_visitors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ def walk(self, desc: Descriptor) -> bool:
116116
# Group fields by oneof to generate if/elif chains
117117
oneof_fields: dict[int, list[FieldDescriptor]] = {}
118118
regular_fields: list[FieldDescriptor] = []
119-
119+
120120
for field in desc.fields:
121121
if field.type != FieldDescriptor.TYPE_MESSAGE:
122122
continue
123-
123+
124124
# Skip synthetic oneofs (proto3 optional fields)
125125
if field.containing_oneof is not None:
126126
oneof_idx = field.containing_oneof.index

0 commit comments

Comments
 (0)