fix: use rprint instead of click.echo for Rich markup error messages - #1437
Merged
codejedi365 merged 2 commits intoJul 5, 2026
Conversation
codejedi365
force-pushed
the
fix/version-error-message-not-formatted-1423
branch
2 times, most recently
from
July 5, 2026 17:32
75b1fe9 to
6a92487
Compare
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
force-pushed
the
fix/version-error-message-not-formatted-1423
branch
from
July 5, 2026 18:02
6a92487 to
2f71f3b
Compare
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
semantic-release --verbose --noop --strict versionwith 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, theif opts.strictbranch usesclick.echo(err_msg, err=True)which doesn't process Rich markup. The non-strict path correctly usesrprint(err_msg).Fix
Replace
click.echo(err_msg, err=True)withrprint(err_msg, file=sys.stderr)so both paths render Rich markup consistently.Fixes #1423