From 8c8b81a413efc1e4a9239b221e9b4b5dfcd8100d Mon Sep 17 00:00:00 2001 From: richardpaulhudson Date: Tue, 10 May 2022 09:51:37 +0200 Subject: [PATCH] Fixed formatting issues --- spacy/cli/_util.py | 30 +++++++++++++++--------------- spacy/cli/project/document.py | 4 +++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/spacy/cli/_util.py b/spacy/cli/_util.py index 54a868953..23811afae 100644 --- a/spacy/cli/_util.py +++ b/spacy/cli/_util.py @@ -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. diff --git a/spacy/cli/project/document.py b/spacy/cli/project/document.py index 3813b083d..7be52c841 100644 --- a/spacy/cli/project/document.py +++ b/spacy/cli/project/document.py @@ -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), " → ".join(rendered_steps)]) if data: md.add(md.title(3, "Workflows", "⏭"))