Fixed formatting issues

This commit is contained in:
richardpaulhudson 2022-05-10 09:51:37 +02:00
parent a2bd489a8c
commit 8c8b81a413
2 changed files with 18 additions and 16 deletions

View File

@ -225,12 +225,12 @@ def validate_project_commands(config: Dict[str, Any]) -> None:
def verify_workflow_step(step: str):
if step not in command_names:
msg.fail(
f"Unknown command specified in workflow '{workflow_name}': {step}",
f"Workflows can only refer to commands defined in the 'commands' "
f"section of the {PROJECT_FILE}.",
exits=1,
)
msg.fail(
f"Unknown command specified in workflow '{workflow_name}': {step}",
f"Workflows can only refer to commands defined in the 'commands' "
f"section of the {PROJECT_FILE}.",
exits=1,
)
command_names = [cmd["name"] for cmd in config.get("commands", [])]
workflows = config.get("workflows", {})
@ -249,19 +249,19 @@ def validate_project_commands(config: Dict[str, Any]) -> None:
workflow_list = cast(List[str], step_or_list)
if len(workflow_list) < 2:
msg.fail(
f"Invalid multiprocessing group within '{workflow_name}'.",
f"A multiprocessing group must reference at least two commands.",
exits=1,
)
f"Invalid multiprocessing group within '{workflow_name}'.",
f"A multiprocessing group must reference at least two commands.",
exits=1,
)
if len(workflow_list) != len(set(workflow_list)):
msg.fail(
f"A multiprocessing group within '{workflow_name}' contains a command more than once.",
f"This is not permitted because it is then not possible to determine when to rerun.",
exits=1,
)
f"A multiprocessing group within '{workflow_name}' contains a command more than once.",
f"This is not permitted because it is then not possible to determine when to rerun.",
exits=1,
)
for step in workflow_list:
verify_workflow_step(step)
def get_hash(data, exclude: Iterable[str] = tuple()) -> str:
"""Get the hash for a JSON-serializable object.

View File

@ -76,7 +76,9 @@ def project_document(
if isinstance(step, str):
rendered_steps.append(md.code(step))
else:
rendered_steps.append('[' + ', '.join(md.code(p_step) for p_step in step) + ']')
rendered_steps.append(
"[" + ", ".join(md.code(p_step) for p_step in step) + "]"
)
data.append([md.code(n), " &rarr; ".join(rendered_steps)])
if data:
md.add(md.title(3, "Workflows", ""))