MCPcopy Create free account
hub / github.com/apache/fory / source_header

Method source_header

compiler/fory_compiler/generators/scala.py:381–391  ·  view source on GitHub ↗
(self, imports: Set[str])

Source from the content-addressed store, hash-verified

379 return self.source_file(message.name, lines)
380
381 def source_header(self, imports: Set[str]) -> List[str]:
382 lines = [self.get_license_header(), ""]
383 package = self.get_scala_package()
384 if package:
385 lines.append(f"package {package}")
386 lines.append("")
387 for item in sorted(imports):
388 lines.append(f"import {item}")
389 if imports:
390 lines.append("")
391 return lines
392
393 def source_file(self, type_name: str, lines: List[str]) -> GeneratedFile:
394 path = self.get_scala_package_path()

Calls 3

get_scala_packageMethod · 0.95
get_license_headerMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected