Skip to content

fix: use rprint instead of click.echo for Rich markup error messages - #1437

Merged
codejedi365 merged 2 commits into
python-semantic-release:masterfrom
frankgoldfish:fix/version-error-message-not-formatted-1423
Jul 5, 2026
Merged

fix: use rprint instead of click.echo for Rich markup error messages#1437
codejedi365 merged 2 commits into
python-semantic-release:masterfrom
frankgoldfish:fix/version-error-message-not-formatted-1423

Conversation

@frankgoldfish

Copy link
Copy Markdown
Contributor

Problem

When running semantic-release --verbose --noop --strict version with no new commits since the last release, the error message is printed with literal Rich markup tags instead of formatted text:

Actual: [bold orange1]No release will be made, ...
Expected: Formatted bold orange message

Root cause

In cli/commands/version.py, the if opts.strict branch uses click.echo(err_msg, err=True) which doesn't process Rich markup. The non-strict path correctly uses rprint(err_msg).

Fix

Replace click.echo(err_msg, err=True) with rprint(err_msg, file=sys.stderr) so both paths render Rich markup consistently.

Fixes #1423

@github-actions github-actions Bot added the stale label May 17, 2026
@github-actions github-actions Bot closed this May 27, 2026
@codejedi365 codejedi365 reopened this May 27, 2026
@codejedi365 codejedi365 added confirmed Prevent from becoming stale and removed stale labels May 27, 2026
@codejedi365
codejedi365 force-pushed the fix/version-error-message-not-formatted-1423 branch 2 times, most recently from 75b1fe9 to 6a92487 Compare July 5, 2026 17:32
codejedi365 and others added 2 commits July 5, 2026 12:02
When `semantic-release version` is run with `--strict` and no new
commits have been found, the error message containing Rich markup
([bold orange1]...) was passed to `click.echo()` instead of
`rprint()`, causing the markup tags to be printed literally rather
than rendered as formatted text.

Resolves: python-semantic-release#1423

Co-authored-by: frankgoldfish <frankgoldfish5@gmail.com>
Signed-off-by: codejedi365 <codejedi365@users.noreply.github.com>
@codejedi365
codejedi365 force-pushed the fix/version-error-message-not-formatted-1423 branch from 6a92487 to 2f71f3b Compare July 5, 2026 18:02
@codejedi365
codejedi365 merged commit 5e8f94c into python-semantic-release:master Jul 5, 2026
9 checks passed
@codejedi365 codejedi365 added released and removed confirmed Prevent from becoming stale labels Jul 6, 2026
@codejedi365

Copy link
Copy Markdown
Contributor

🎉 This PR has been published as part of v10.6.1 🎉

You can find more information about this release on the GitHub Releases page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error message misformatted

2 participants