Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cli): fail with exit code 2 when no subcommand is given tosemantic-release#1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
codejedi365 wants to merge2 commits intopython-semantic-release:master
base:master
Choose a base branch
Loading
fromcodejedi365:fix/cli-exit-code-wo-cmd
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionssrc/semantic_release/cli/commands/main.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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(
Expand Down
4 changes: 2 additions & 2 deletionstests/e2e/test_main.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@
)

# Evaluate
assert SUCCESS_EXIT_CODE == proc.returncode # noqa: SIM300

Check failure on line 47 in tests/e2e/test_main.py

View workflow job for this annotation

GitHub Actions/ validate / Python 3.14 on ubuntu-latest E2E tests

test_main.test_entrypoint_scripts[psr]

assert == failed. [pytest-clarity diff shown] #x1B[0m #x1B[0m#x1B[32mLHS#x1B[0m vs #x1B[31mRHS#x1B[0m shown below #x1B[0m #x1B[0m#x1B[32m+ 0#x1B[0m #x1B[0m#x1B[31m- 2#x1B[0m #x1B[0m

Check failure on line 47 in tests/e2e/test_main.py

View workflow job for this annotation

GitHub Actions/ validate / Python 3.14 on ubuntu-latest E2E tests

test_main.test_entrypoint_scripts[python-semantic-release]

assert == failed. [pytest-clarity diff shown] #x1B[0m #x1B[0m#x1B[32mLHS#x1B[0m vs #x1B[31mRHS#x1B[0m shown below #x1B[0m #x1B[0m#x1B[32m+ 0#x1B[0m #x1B[0m#x1B[31m- 2#x1B[0m #x1B[0m

Check failure on line 47 in tests/e2e/test_main.py

View workflow job for this annotation

GitHub Actions/ validate / Python 3.14 on ubuntu-latest E2E tests

test_entrypoint_scripts[psr]assert == failed. [pytest-clarity diff shown] LHS vs RHS shown below + 0 - 2

Check failure on line 47 in tests/e2e/test_main.py

View workflow job for this annotation

GitHub Actions/ validate / Python 3.14 on ubuntu-latest E2E tests

test_entrypoint_scripts[python-semantic-release]assert == failed. [pytest-clarity diff shown] LHS vs RHS shown below + 0 - 2
assert expected_output == proc.stdout
assert not proc.stderr

Expand All@@ -60,12 +60,12 @@
assert result.output == f"semantic-release, version {__version__}\n"


deftest_main_no_args_passes_w_help_text():
deftest_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


Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp