Skip to content

Conversation

@yjaw
Copy link

@yjaw yjaw commented Jan 27, 2026

Description

Add --tag flag to cz version command to output version with
configured tag_format applied (e.g., v1.2.3 instead of 1.2.3).

  • Add --tag option to CLI arguments
  • Implement tag formatting using TagRules.normalize_tag()
  • Add error handling for invalid option combinations
  • Update tests to match new error messages

Closes #1765

Checklist

Code Changes

  • [o] Add test cases to all the changes you introduce
  • [o] Run uv run poe all locally to ensure this change passes linter check and tests
  • [o] Manually test the changes:
  • [o] Verify the feature/bug fix works as expected in real-world scenarios
  • [o] Test edge cases and error conditions
  • [o] Ensure backward compatibility is maintained
  • Document any manual testing steps performed
  • Update the documentation for the changes

Steps to Test This Pull Request

Additional Context

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.96%. Comparing base (5857050) to head (c366400).
⚠️ Report is 13 commits behind head on next-release.

Additional details and impacted files
@@              Coverage Diff              @@
##           next-release    #1819   +/-   ##
=============================================
  Coverage         97.96%   97.96%           
=============================================
  Files                60       60           
  Lines              2648     2656    +8     
=============================================
+ Hits               2594     2602    +8     
  Misses               54       54           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yjaw yjaw force-pushed the feature/version-tag-option branch from 6e98f8e to c366400 Compare January 28, 2026 08:53
@Lee-W Lee-W changed the base branch from master to next-release January 31, 2026 07:39
@Lee-W Lee-W merged commit 382525e into commitizen-tools:next-release Jan 31, 2026
20 checks passed
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.

Add cz version --tag

3 participants