feat(bump): add --version-files-only and deprecate --files-only by bearomorphism · Pull Request #1802 · commitizen-tools/commitizen

@bearomorphism

Rework of #1659. It was close to merge.

Closes #1658

@codecov

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.96%. Comparing base (89f6b8f) to head (527c814).
⚠️ Report is 7 commits behind head on next-release.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff              @@
##           next-release    #1802   +/-   ##
=============================================
  Coverage         97.96%   97.96%           
=============================================
  Files                60       60           
  Lines              2651     2655    +4     
=============================================
+ Hits               2597     2601    +4     
  Misses               54       54           

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

Lee-W

Choose a reason for hiding this comment

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

a few nits

configuration file only.
configuration file only(deprecated; use --version-
files-only instead).
--version-files-only bump version in the files from the config

Choose a reason for hiding this comment

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

--version-files-only bump version in the files from the config
--version-files-only Bump version in the files from the config

Choose a reason for hiding this comment

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

we should not comment suggested changes on test files generated by pytest file regression though

{
"name": "--version-files-only",
"action": "store_true",
"help": "bump version in the files from the config",

Choose a reason for hiding this comment

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

"help": "bump version in the files from the config",
"help": "Bump version in the files from the config",

Comment on lines +1472 to +1474

with pytest.warns(DeprecationWarning):
with pytest.raises(ExpectedExit):
util.run_cli("bump", "--yes", "--files-only")

Choose a reason for hiding this comment

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

with pytest.warns(DeprecationWarning):
with pytest.raises(ExpectedExit):
util.run_cli("bump", "--yes", "--files-only")
with pytest.warns(DeprecationWarning), pytest.raises(ExpectedExit):
util.run_cli("bump", "--yes", "--files-only")

Choose a reason for hiding this comment

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

I didn't know this also works

@2509abhi @bearomorphism

bearomorphism added a commit that referenced this pull request

Feb 1, 2026
Co-authored-by: abhishek <abhishekbansal8948@gmail.com>