Preflight Scala package and helper paths before writing output.
(
files: List[Path],
import_paths: List[Path],
grpc: bool = False,
)
| 387 | |
| 388 | |
| 389 | def validate_scala_generation( |
| 390 | files: List[Path], |
| 391 | import_paths: List[Path], |
| 392 | grpc: bool = False, |
| 393 | ) -> bool: |
| 394 | """Preflight Scala package and helper paths before writing output.""" |
| 395 | cache: Dict[Path, Schema] = {} |
| 396 | graph: List[Tuple[Path, Schema]] = [] |
| 397 | for file_path in files: |
| 398 | file_graph = collect_schema_graph(file_path, import_paths, cache, set()) |
| 399 | if file_graph is None: |
| 400 | return False |
| 401 | graph.extend(file_graph) |
| 402 | if not validate_scala_import_packages(graph): |
| 403 | return False |
| 404 | return validate_scala_output_paths(graph, grpc=grpc) |
| 405 | |
| 406 | |
| 407 | def _find_go_module_root(base_go_out: Path) -> Optional[Path]: |