From b10d0d4b78e28e9eec0734b14f5c710110f59727 Mon Sep 17 00:00:00 2001 From: David Pape Date: Wed, 11 Jan 2023 13:16:34 +0100 Subject: [PATCH 1/2] Rename post to post[-_]process in various places --- src/hermes/cli.py | 4 ++-- src/hermes/commands/workflow.py | 2 +- test/hermes_test/test_cli.py | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/hermes/cli.py b/src/hermes/cli.py index 81cc28ba..ca2fc93f 100644 --- a/src/hermes/cli.py +++ b/src/hermes/cli.py @@ -140,7 +140,7 @@ def _process_result(value: t.Any) -> t.Any: @click.group(cls=WorkflowCommand, invoke_without_command=True) @click.option("--deposit", is_flag=True, default=False) -@click.option("--post", is_flag=True, default=False) +@click.option("--post-process", is_flag=True, default=False) @click.option('--path', default=pathlib.Path('./'), help='Working path', type=pathlib.Path) @click.pass_context def main(ctx: click.Context, *args, **kwargs) -> None: @@ -156,4 +156,4 @@ def main(ctx: click.Context, *args, **kwargs) -> None: main.add_command(workflow.harvest) main.add_command(workflow.process) main.add_command(workflow.deposit) -main.add_command(workflow.post) +main.add_command(workflow.postprocess) diff --git a/src/hermes/commands/workflow.py b/src/hermes/commands/workflow.py index 84d2a688..58cdd72d 100644 --- a/src/hermes/commands/workflow.py +++ b/src/hermes/commands/workflow.py @@ -117,7 +117,7 @@ def deposit(): @click.group(invoke_without_command=True) -def post(): +def post_process(): """ Post-process metadata after deposition """ diff --git a/test/hermes_test/test_cli.py b/test/hermes_test/test_cli.py index d535a357..e80ed17d 100644 --- a/test/hermes_test/test_cli.py +++ b/test/hermes_test/test_cli.py @@ -101,9 +101,9 @@ def test_hermes_with_deposit(): assert not result.exception -def test_hermes_with_post(): +def test_haggis_with_post_process(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--post', )) + result = runner.invoke(cli.main, args=('--post-process', )) assert not result.exception @@ -115,9 +115,9 @@ def test_hermes_with_path(): assert not result.exception -def test_hermes_with_deposit_and_post(): +def test_hermes_with_deposit_and_post_process(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--deposit', '--post')) + result = runner.invoke(cli.main, args=('--deposit', '--post-process')) assert not result.exception @@ -129,15 +129,15 @@ def test_hermes_with_deposit_and_path(): assert not result.exception -def test_hermes_with_path_and_post(): +def test_hermes_with_path_and_post_process(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--path', './', '--post')) + result = runner.invoke(cli.main, args=('--path', './', '--post-process')) assert not result.exception -def test_hermes_with_deposit_and_post_and_path(): +def test_hermes_with_deposit_and_post_process_and_path(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--deposit', '--post', '--path', './')) + result = runner.invoke(cli.main, args=('--deposit', '--post-process', '--path', './')) assert not result.exception From 0d44d876d2b5d1cd00e84432afbac9c4cc54109c Mon Sep 17 00:00:00 2001 From: David Pape Date: Wed, 11 Jan 2023 13:40:50 +0100 Subject: [PATCH 2/2] Spell noun with, verb without hyphen --- src/hermes/cli.py | 2 +- src/hermes/commands/process/cff.py | 2 +- src/hermes/commands/workflow.py | 4 ++-- test/hermes_test/test_cli.py | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/hermes/cli.py b/src/hermes/cli.py index ca2fc93f..d7519fff 100644 --- a/src/hermes/cli.py +++ b/src/hermes/cli.py @@ -140,7 +140,7 @@ def _process_result(value: t.Any) -> t.Any: @click.group(cls=WorkflowCommand, invoke_without_command=True) @click.option("--deposit", is_flag=True, default=False) -@click.option("--post-process", is_flag=True, default=False) +@click.option("--postprocess", is_flag=True, default=False) @click.option('--path', default=pathlib.Path('./'), help='Working path', type=pathlib.Path) @click.pass_context def main(ctx: click.Context, *args, **kwargs) -> None: diff --git a/src/hermes/commands/process/cff.py b/src/hermes/commands/process/cff.py index cfba41e0..88dc2b9b 100644 --- a/src/hermes/commands/process/cff.py +++ b/src/hermes/commands/process/cff.py @@ -13,7 +13,7 @@ def add_name(ctx: CodeMetaContext, harvest_ctx: HermesHarvestContext): """ Augment each author with a `name` attribute (if not present). - This will allow better matching against the git authors and can be removed in a post-process step. + This will allow better matching against the git authors and can be removed in a post-processing step. :param ctx: The resulting context that should contain the harmonized data. :param harvest_ctx: The harvest context containing all raw harvested data. diff --git a/src/hermes/commands/workflow.py b/src/hermes/commands/workflow.py index 58cdd72d..d22de701 100644 --- a/src/hermes/commands/workflow.py +++ b/src/hermes/commands/workflow.py @@ -117,8 +117,8 @@ def deposit(): @click.group(invoke_without_command=True) -def post_process(): +def postprocess(): """ - Post-process metadata after deposition + Postprocess metadata after deposition """ click.echo("Post-processing") diff --git a/test/hermes_test/test_cli.py b/test/hermes_test/test_cli.py index e80ed17d..14daf260 100644 --- a/test/hermes_test/test_cli.py +++ b/test/hermes_test/test_cli.py @@ -101,9 +101,9 @@ def test_hermes_with_deposit(): assert not result.exception -def test_haggis_with_post_process(): +def test_haggis_with_postprocess(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--post-process', )) + result = runner.invoke(cli.main, args=('--postprocess', )) assert not result.exception @@ -115,9 +115,9 @@ def test_hermes_with_path(): assert not result.exception -def test_hermes_with_deposit_and_post_process(): +def test_haggis_with_deposit_and_postprocess(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--deposit', '--post-process')) + result = runner.invoke(cli.main, args=('--deposit', '--postprocess')) assert not result.exception @@ -129,15 +129,15 @@ def test_hermes_with_deposit_and_path(): assert not result.exception -def test_hermes_with_path_and_post_process(): +def test_haggis_with_path_and_postprocess(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--path', './', '--post-process')) + result = runner.invoke(cli.main, args=('--path', './', '--postprocess')) assert not result.exception -def test_hermes_with_deposit_and_post_process_and_path(): +def test_haggis_with_deposit_and_postprocess_and_path(): runner = CliRunner() - result = runner.invoke(cli.main, args=('--deposit', '--post-process', '--path', './')) + result = runner.invoke(cli.main, args=('--deposit', '--postprocess', '--path', './')) assert not result.exception