Check package combinations that Scala source cannot compile.
(graph: List[Tuple[Path, Schema]])
| 343 | |
| 344 | |
| 345 | def validate_scala_import_packages(graph: List[Tuple[Path, Schema]]) -> bool: |
| 346 | """Check package combinations that Scala source cannot compile.""" |
| 347 | packages = {scala_package_for_schema(schema) for _, schema in graph} |
| 348 | if None not in packages or len(packages) <= 1: |
| 349 | return True |
| 350 | details = ", ".join( |
| 351 | f"{package or '<default>'}: {path}" |
| 352 | for path, schema in sorted(graph, key=lambda item: str(item[0])) |
| 353 | for package in [scala_package_for_schema(schema)] |
| 354 | ) |
| 355 | print( |
| 356 | "Error: Scala imports cannot mix default-package schemas with named " |
| 357 | f"Scala packages; found {details}", |
| 358 | file=sys.stderr, |
| 359 | ) |
| 360 | return False |
| 361 | |
| 362 | |
| 363 | def validate_scala_output_paths( |
no test coverage detected