mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
MaD generator: run formatter
This commit is contained in:
@@ -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(
|
||||||
|
"Project",
|
||||||
|
{
|
||||||
"name": Required[str],
|
"name": Required[str],
|
||||||
"git-repo": str,
|
"git-repo": str,
|
||||||
"git-tag": str,
|
"git-tag": str,
|
||||||
"with-sinks": bool,
|
"with-sinks": bool,
|
||||||
"with-sources": bool,
|
"with-sources": bool,
|
||||||
"with-summaries": bool,
|
"with-summaries": bool,
|
||||||
}, total=False)
|
},
|
||||||
|
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],
|
||||||
*,
|
*,
|
||||||
|
|||||||
Reference in New Issue
Block a user