Skip to content

Conversation

@woile
Copy link
Member

@woile woile commented Oct 30, 2025

Description

Allow the ability to just print major or minor from a version when using cz version -p.

This is useful, because under some scenarios, users may need just a chunk of the version. Example:

  • github actions recommend using a vX tag, where X is the major, this tag is moved to the latest commit usually.
  • docker image tags
  • api versioning
  • go modules

Checklist

Code Changes

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
  • Update the documentation for the changes

Documentation Changes

  • Run poetry doc locally to ensure the documentation pages renders correctly

Expected Behavior

cz version -p major should render the major part only

cz version -p minor should render the minor part only

Closes #1638

@woile
Copy link
Member Author

woile commented Oct 30, 2025

how am I supposed to fix Run codespell to check for common misspellings in files?

@Lee-W
Copy link
Member

Lee-W commented Oct 30, 2025

I usually use pre-commit run codespell --all-files

@woile woile force-pushed the feat/version-info branch from df79339 to 2fa851b Compare October 31, 2025 10:53
@woile
Copy link
Member Author

woile commented Oct 31, 2025

Fixed! 🤞🏻

@Lee-W Lee-W added this to the 4.10.0 milestone Nov 2, 2025
@woile woile force-pushed the feat/version-info branch from 2fa851b to 7ca2b16 Compare November 4, 2025 12:26
@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v4-9-2@b76301d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
commitizen/commands/version.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             v4-9-2    #1639   +/-   ##
=========================================
  Coverage          ?   98.18%           
=========================================
  Files             ?       58           
  Lines             ?     2706           
  Branches          ?        0           
=========================================
  Hits              ?     2657           
  Misses            ?       49           
  Partials          ?        0           
Flag Coverage Δ
unittests 98.18% <84.61%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Lee-W Lee-W changed the base branch from master to v4-9-2 November 8, 2025 07:35
@Lee-W Lee-W merged commit 5e9c5f5 into v4-9-2 Nov 8, 2025
17 of 18 checks passed
@Lee-W Lee-W deleted the feat/version-info branch November 8, 2025 07:37
@woile woile restored the feat/version-info branch November 8, 2025 08:08
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.

Cannot install the project because of poetthepoet

4 participants