MaD generator: run formatter

This commit is contained in:
Paolo Tranquilli
2025-06-10 12:11:00 +02:00
parent bcfc009228
commit ecc35e5a07

View File

@@ -16,10 +16,14 @@ import zipfile
import tarfile import tarfile
import shutil import shutil
def missing_module(module_name: str) -> None: def missing_module(module_name: str) -> None:
print(f"ERROR: {module_name} is not installed. Please install it with 'pip install {module_name}'.") print(
f"ERROR: {module_name} is not installed. Please install it with 'pip install {module_name}'."
)
sys.exit(1) sys.exit(1)
try: try:
import yaml import yaml
except ImportError: except ImportError:
@@ -41,14 +45,19 @@ build_dir = os.path.join(gitroot, "mad-generation-build")
# A project to generate models for # A project to generate models for
Project = TypedDict("Project", { Project = TypedDict(
"name": Required[str], "Project",
"git-repo": str, {
"git-tag": str, "name": Required[str],
"with-sinks": bool, "git-repo": str,
"with-sources": bool, "git-tag": str,
"with-summaries": bool, "with-sinks": bool,
}, total=False) "with-sources": bool,
"with-summaries": bool,
},
total=False,
)
def should_generate_sinks(project: Project) -> bool: def should_generate_sinks(project: Project) -> bool:
return project.get("with-sinks", True) return project.get("with-sinks", True)
@@ -107,7 +116,9 @@ def clone_project(project: Project) -> str:
return target_dir return target_dir
def run_in_parallel[T, U]( def run_in_parallel[
T, U
](
func: Callable[[T], U], func: Callable[[T], U],
items: List[T], items: List[T],
*, *,