Check package combinations that Kotlin source cannot compile.
(graph: List[Tuple[Path, Schema]])
| 261 | |
| 262 | |
| 263 | def validate_kotlin_import_packages(graph: List[Tuple[Path, Schema]]) -> bool: |
| 264 | """Check package combinations that Kotlin source cannot compile.""" |
| 265 | packages = {kotlin_package_for_schema(schema) for _, schema in graph} |
| 266 | if None not in packages or len(packages) <= 1: |
| 267 | return True |
| 268 | details = ", ".join( |
| 269 | f"{package or '<default>'}: {path}" |
| 270 | for path, schema in sorted(graph, key=lambda item: str(item[0])) |
| 271 | for package in [kotlin_package_for_schema(schema)] |
| 272 | ) |
| 273 | print( |
| 274 | "Error: Kotlin imports cannot mix default-package schemas with named " |
| 275 | f"Kotlin packages; found {details}", |
| 276 | file=sys.stderr, |
| 277 | ) |
| 278 | return False |
| 279 | |
| 280 | |
| 281 | def validate_kotlin_output_paths( |
no test coverage detected