From c530dc51b278e4cb35fbef862b8c785c9e33dd8f Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 25 May 2025 13:36:30 -0600 Subject: [PATCH 1/2] test(e2e): define exit code behavior (=2) when no args are passed to PSR --- tests/e2e/test_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_main.py b/tests/e2e/test_main.py index 8ce3c58a5..b7e8d00d0 100644 --- a/tests/e2e/test_main.py +++ b/tests/e2e/test_main.py @@ -61,12 +61,12 @@ def test_main_prints_version_and_exits(run_cli: RunCliFn): assert result.output == f"semantic-release, version {__version__}\n" -def test_main_no_args_passes_w_help_text(): +def test_main_no_args_fails_w_help_text(): from semantic_release.cli.commands.main import main cli_cmd = [MAIN_PROG_NAME] result = CliRunner().invoke(main, prog_name=cli_cmd[0]) - assert_successful_exit_code(result, cli_cmd) + assert_exit_code(2, result, cli_cmd) assert "Usage: " in result.output From 97870060ebd9c71abfbdad0c76460f18fa58d6bb Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 25 May 2025 13:37:22 -0600 Subject: [PATCH 2/2] fix(cli): fail with exitcode 2 when no subcommand is given to `semantic-release` --- src/semantic_release/cli/commands/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/semantic_release/cli/commands/main.py b/src/semantic_release/cli/commands/main.py index c10d3f647..71c5f0778 100644 --- a/src/semantic_release/cli/commands/main.py +++ b/src/semantic_release/cli/commands/main.py @@ -61,6 +61,7 @@ def get_command(self, _ctx: click.Context, name: str) -> click.Command | None: cls=Cli, context_settings={ "help_option_names": ["-h", "--help"], + "resilient_parsing": True, }, ) @click.version_option( pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy