Skip to content

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented May 25, 2021

Description

  • Fix bumping only on the first few matches
  • fix error due to bumping version file without eol through regex
    • see tests/test_bump_update_version_in_files/test_multiplt_versions_to_bump_without_eol_.toml in 943d873 as example, our original bumping mechanism will not bump the last one.

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

Bump all version specified in version_files

Steps to Test This Pull Request

  1. git clone //github.com/pedrorrivero/qrand
  2. git checkout 0.3.0a0
  3. cz bump

Additional context

Lee-W added 4 commits May 25, 2021 19:45
for examply, if what we want to bump is "version = 1.2.9", we still lookup up "version = 2.0.0" and changed the offset
this is fixed by changing offset only when matching is found

#383
@Lee-W Lee-W requested a review from woile May 25, 2021 14:49
@Lee-W
Copy link
Member Author

Lee-W commented May 25, 2021

@woile I'm thinking of refactoring test through pytest-regressions like this commit. What do you think? Basically, it checks whether our result in this round is different from the previous round. By doing so, we can check whether the content is exactly the same instead of check only a few lines.

@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #386 (801a715) into master (e107411) will increase coverage by 0.21%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
+ Coverage   97.67%   97.89%   +0.21%     
==========================================
  Files          39       39              
  Lines        1378     1375       -3     
==========================================
  Hits         1346     1346              
+ Misses         32       29       -3     
Flag Coverage Δ
unittests 97.89% <100.00%> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/bump.py 100.00% <100.00%> (ø)
commitizen/config/toml_config.py 100.00% <100.00%> (ø)
commitizen/git.py 100.00% <0.00%> (+3.37%) ⬆️

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 aa0debe...801a715. Read the comment docs.

@Lee-W Lee-W force-pushed the fix-bumping-only-on-first-few-matches branch from 298ddb1 to 6564682 Compare May 26, 2021 10:02
@Lee-W
Copy link
Member Author

Lee-W commented May 26, 2021

@woile I accidentally find another bug and fixed it. Could you please check again? In tests/test_bump_update_version_in_files/test_multiplt_versions_to_bump_without_eol_.toml on 943d873, our original bumping mechanism will not bump the last line. This has been fixed on e0af6a2. If it looks good, I think we're ready to merge.

@woile
Copy link
Member

woile commented May 26, 2021

Niceee, LGTM!

@Lee-W Lee-W merged commit 9607874 into master May 26, 2021
@Lee-W Lee-W deleted the fix-bumping-only-on-first-few-matches branch May 26, 2021 14:11
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.

2 participants