Skip to content

feat(bump): add support to bumping local version #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 14, 2020
Merged

feat(bump): add support to bumping local version #303

merged 4 commits into from
Nov 14, 2020

Conversation

marcossantiago
Copy link
Contributor

@marcossantiago marcossantiago commented Nov 12, 2020

Description

This PR creates adds a new flag --local-version to the bump command that allows bumping the local version only instead of the public release.

PS: I haven't create the tests/updated the documentation just yet. will do after confirmation the code is suitable.

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

The current behavior of the bump ignores the local version and only bumps the public version.

$ cz bump --files-only --yes
bump: version 2.6.0+3.0.0 → 2.7.0

This flag allows to bump only the local portion of the version like

$ cz bump --files-only --yes --local-version
bump: version 2.6.0+3.0.0 → 2.6.0+4.0.0

Steps to Test This Pull Request

  1. Specify the version with a local portion like version = "5.6.0+0.0.1".
  2. Execute the bump with the flag --local-version.

Additional context

Issue: #302
References: Python 440 Local version

@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #303 (720befe) into master (0be6d0b) will increase coverage by 0.34%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #303      +/-   ##
==========================================
+ Coverage   96.62%   96.96%   +0.34%     
==========================================
  Files          33       33              
  Lines         919      924       +5     
==========================================
+ Hits          888      896       +8     
+ Misses         31       28       -3     
Flag Coverage Δ
unittests 96.96% <100.00%> (+0.34%) ⬆️

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

Impacted Files Coverage Δ
commitizen/cli.py 97.36% <ø> (ø)
commitizen/commands/init.py 91.30% <ø> (ø)
commitizen/defaults.py 100.00% <ø> (ø)
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/bump.py 94.31% <100.00%> (+3.72%) ⬆️
commitizen/commands/changelog.py 97.29% <100.00%> (ø)
commitizen/git.py 95.55% <100.00%> (+0.04%) ⬆️
commitizen/cz/base.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae03624...720befe. Read the comment docs.

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

Could you please add a test for this change?

@marcossantiago
Copy link
Contributor Author

Sure! Doing shortly.

@marcossantiago
Copy link
Contributor Author

@Lee-W here it goes.

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

Only one typo need to be fixed. Other parts looks good to me 🎉 @woile Could you please double check whether everything's good 🙂

@woile woile merged commit 6cfa014 into commitizen-tools:master Nov 14, 2020
@woile
Copy link
Member

woile commented Nov 14, 2020

Fantastic, thanks!

@marcossantiago marcossantiago deleted the bump_add_local_version_flags branch November 14, 2020 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants