Skip to content

Conversation

@bearomorphism
Copy link
Contributor

@bearomorphism bearomorphism commented Nov 10, 2025

Changes

  1. Remove unreachable logic, such as setting dry_run = True while we already have get_next = True. The latter condition raises a GetNextExit() exception in the original code, so no effect if we set dry_run to True. Moreover, the original code is self.dry_run = True which is ineffective since we never use the member variable.
  2. Simplify things.
  3. Rename the variable get_next to next_version_to_stdout. The variable name get_next is very unclear and hard to guess what it will do. I think we can consider renaming the option in the next major release.
  4. (relate Not possible to use --get-next when changelog is enabled #1640) Replace NotAllowed related to --get-next option with warnings.
  5. Remove GetNextExit exception because we already have DryRunExit. --get-next is just --dry-run but doing less things IMO.

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 97.15447% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v4-10-1@939ee43). Learn more about missing BASE report.

Files with missing lines Patch % Lines
commitizen/commands/version.py 78.57% 3 Missing ⚠️
commitizen/commands/bump.py 88.88% 1 Missing ⚠️
commitizen/commands/commit.py 96.66% 1 Missing ⚠️
commitizen/config/__init__.py 95.65% 1 Missing ⚠️
commitizen/config/factory.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v4-10-1    #1644   +/-   ##
==========================================
  Coverage           ?   98.64%           
==========================================
  Files              ?       60           
  Lines              ?     2651           
  Branches           ?        0           
==========================================
  Hits               ?     2615           
  Misses             ?       36           
  Partials           ?        0           
Flag Coverage Δ
unittests 98.64% <97.15%> (?)

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.

@bearomorphism bearomorphism changed the title refactor(bump): remove unused member fix(bump): remove NotAllowed Nov 10, 2025
@bearomorphism bearomorphism changed the title fix(bump): remove NotAllowed fix(bump): remove NotAllowed related to --get-next option, and other related refactoring Nov 10, 2025
@bearomorphism bearomorphism marked this pull request as ready for review November 10, 2025 13:55
@bearomorphism bearomorphism changed the base branch from v4-10-0 to v4-10-1 November 10, 2025 13:58
@bearomorphism bearomorphism changed the base branch from v4-10-1 to v4-10-0 November 10, 2025 14:01
@Lee-W Lee-W deleted the branch commitizen-tools:v4-10-0 November 10, 2025 14:08
@Lee-W Lee-W closed this Nov 10, 2025
@Lee-W
Copy link
Member

Lee-W commented Nov 11, 2025

ah... didn't notice this one. I thought I moved all the PRs out of v4-10-0

@bearomorphism
Copy link
Contributor Author

It's ok this was a very new PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants