Skip to content

Conversation

@mskrajnowski
Copy link
Contributor

If there were any characters after the last label in the serialize string, _labels_for_format would return an extra None label.

Example config file:

[bumpversion:file:bower.json]
parse = "version": "(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"
serialize = "version": "{major}.{minor}.{patch}"

@peritus
Copy link
Owner

peritus commented Oct 22, 2014

Needs regression test case demonstrating the bug.

@peritus
Copy link
Owner

peritus commented Oct 22, 2014

Thanks for the pull request, you seem to have a valid case here.

Also thanks for pointing out that I didn't mention the search/replace options in the README. Using these, you should be able to simplify your config as follows (assuming you want to inherit the {major}.{minor}.{patch} defaults):

[bumpversion:file:bower.json]
search = "version": "{current_version}"
replace = "version": "{new_version}"

peritus added a commit that referenced this pull request Oct 22, 2014
peritus added a commit that referenced this pull request Oct 22, 2014
Fix: _labels_for_format was returning None labels
@peritus peritus merged commit 6296f3c into peritus:master Oct 22, 2014
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