Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienVannson committed Nov 8, 2024
1 parent 6ebbbd2 commit de660dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/betterproto/compile/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ def parse_source_type_name(
Split full source type name into package and type name.
E.g. 'root.package.Message' -> ('root.package', 'Message')
'root.Message.SomeEnum' -> ('root', 'Message.SomeEnum')
The function goes through the symbols that have been defined (names, enums, packages) to find the actual package and
name of the object that is referenced.
"""
if field_type_name[0] != ".":
raise RuntimeError
raise RuntimeError("relative names are not supported")
field_type_name = field_type_name[1:]
parts = field_type_name.split(".")

Expand Down
3 changes: 3 additions & 0 deletions src/betterproto/plugin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def __post_init__(self) -> None:
raise ValueError(f"`{field_name}` is a required field.")

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

@property
Expand Down

0 comments on commit de660dd

Please sign in to comment.