Skip to content

Commit 28f5894

Browse files
committed
Add documentation
1 parent 978f8a4 commit 28f5894

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/betterproto/compile/importing.py

Lines changed: 4 additions & 1 deletion
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ def __post_init__(self) -> None:
203203
raise ValueError(f"`{field_name}` is a required field.")
204204

205205
def ready(self) -> None:
206+
"""
207+
This function is called after all the compilers are created, but before generating the output code.
208+
"""
206209
pass
207210

208211
@property

0 commit comments

Comments
 (0)