Skip to content

Commit bde69da

Browse files
committed
Format
1 parent 36aea08 commit bde69da

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/betterproto/compile/importing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818

1919
if TYPE_CHECKING:
20-
from ..plugin.typing_compiler import TypingCompiler
2120
from ..plugin.models import PluginRequestCompiler
21+
from ..plugin.typing_compiler import TypingCompiler
2222

2323
WRAPPER_TYPES: Dict[str, Type] = {
2424
".google.protobuf.DoubleValue": google_protobuf.DoubleValue,
@@ -33,7 +33,9 @@
3333
}
3434

3535

36-
def parse_source_type_name(field_type_name: str, request: "PluginRequestCompiler") -> Tuple[str, str]:
36+
def parse_source_type_name(
37+
field_type_name: str, request: "PluginRequestCompiler"
38+
) -> Tuple[str, str]:
3739
"""
3840
Split full source type name into package and type name.
3941
E.g. 'root.package.Message' -> ('root.package', 'Message')

src/betterproto/plugin/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
from betterproto.lib.google.protobuf.compiler import CodeGeneratorRequest
6666

6767
from .. import which_one_of
68-
from ..compile.importing import (
69-
get_type_reference,
70-
)
68+
from ..compile.importing import get_type_reference
7169
from ..compile.naming import (
7270
pythonize_class_name,
7371
pythonize_enum_member_name,
@@ -247,7 +245,9 @@ def all_messages(self) -> List["MessageCompiler"]:
247245
List of all of the messages in this request.
248246
"""
249247
return [
250-
msg for output in self.output_packages.values() for msg in output.messages.values()
248+
msg
249+
for output in self.output_packages.values()
250+
for msg in output.messages.values()
251251
]
252252

253253

src/betterproto/plugin/parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ def _traverse(
6060
for i, item in enumerate(items):
6161
# Adjust the name since we flatten the hierarchy.
6262
# Todo: don't change the name, but include full name in returned tuple
63-
should_rename = not isinstance(item, DescriptorProto) or not item.options.map_entry
63+
should_rename = (
64+
not isinstance(item, DescriptorProto) or not item.options.map_entry
65+
)
6466

65-
item.name = next_prefix = f"{prefix}.{item.name}" if prefix and should_rename else item.name
67+
item.name = next_prefix = (
68+
f"{prefix}.{item.name}" if prefix and should_rename else item.name
69+
)
6670
yield item, [*path, i]
6771

6872
if isinstance(item, DescriptorProto):

0 commit comments

Comments
 (0)