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

if (
self.arguments.get("major")
or self.arguments.get("minor")
or self.arguments.get("tag")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to have a separated error message.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, It make sense! I will do it in 1 or 2 days. Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modify error handing for --major, --minor and --tag tag. Please take a look. Thanks!

@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 (82ed078).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1819   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files          60       60           
  Lines        2648     2653    +5     
=======================================
+ Hits         2594     2599    +5     
  Misses         54       54           

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

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

2 participants