Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 58fb099

Browse files
committed
Remove useless code
1 parent c50a84d commit 58fb099

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

src/betterproto2_compiler/plugin/models.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,6 @@
118118
)
119119

120120

121-
# TODO patch again to make field optional
122-
# def monkey_patch_oneof_index():
123-
# """
124-
# The compiler message types are written for proto2, but we read them as proto3.
125-
# For this to work in the case of the oneof_index fields, which depend on being able
126-
# to tell whether they were set, we have to treat them as oneof fields. This method
127-
# monkey patches the generated classes after the fact to force this behaviour.
128-
# """
129-
# object.__setattr__(
130-
# FieldDescriptorProto.__dataclass_fields__["oneof_index"].metadata[
131-
# "betterproto"
132-
# ],
133-
# "group",
134-
# "oneof_index",
135-
# )
136-
# object.__setattr__(
137-
# Field.__dataclass_fields__["oneof_index"].metadata["betterproto"],
138-
# "group",
139-
# "oneof_index",
140-
# )
141-
142-
143121
def get_comment(
144122
proto_file: "FileDescriptorProto",
145123
path: list[int],

src/betterproto2_compiler/plugin/parser.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from betterproto2.lib.google.protobuf import (
66
DescriptorProto,
77
EnumDescriptorProto,
8-
FieldDescriptorProto,
98
FileDescriptorProto,
109
ServiceDescriptorProto,
1110
)
@@ -175,22 +174,6 @@ def generate_code(request: CodeGeneratorRequest) -> CodeGeneratorResponse:
175174
return response
176175

177176

178-
def _make_one_of_field_compiler(
179-
output_package: OutputTemplate,
180-
source_file: "FileDescriptorProto",
181-
parent: MessageCompiler,
182-
proto_obj: "FieldDescriptorProto",
183-
path: list[int],
184-
) -> FieldCompiler:
185-
return OneOfFieldCompiler(
186-
source_file=source_file,
187-
parent=parent,
188-
proto_obj=proto_obj,
189-
path=path,
190-
typing_compiler=output_package.typing_compiler,
191-
)
192-
193-
194177
def read_protobuf_type(
195178
item: DescriptorProto,
196179
path: list[int],

0 commit comments

Comments
 (0)