Skip to content

Commit de660dd

Browse files
committed
Add documentation
1 parent 6ebbbd2 commit de660dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/betterproto/compile/importing.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ def parse_source_type_name(
4040
Split full source type name into package and type name.
4141
E.g. 'root.package.Message' -> ('root.package', 'Message')
4242
'root.Message.SomeEnum' -> ('root', 'Message.SomeEnum')
43+
44+
The function goes through the symbols that have been defined (names, enums, packages) to find the actual package and
45+
name of the object that is referenced.
4346
"""
4447
if field_type_name[0] != ".":
45-
raise RuntimeError
48+
raise RuntimeError("relative names are not supported")
4649
field_type_name = field_type_name[1:]
4750
parts = field_type_name.split(".")
4851

src/betterproto/plugin/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def __post_init__(self) -> None:
181181
raise ValueError(f"`{field_name}` is a required field.")
182182

183183
def ready(self) -> None:
184+
"""
185+
This function is called after all the compilers are created, but before generating the output code.
186+
"""
184187
pass
185188

186189
@property

0 commit comments

Comments
 (0)