Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: how to use parse to deal only with major version?

See original GitHub issue

Hi, after discovering this more up-to-date fork of the original bumpversion project, I’m in the process of switching over to it and I have a question.

I already use bumpversion to maintain version #'s in a few files, where the version # is the full version # (e.g. 3.2.5). I have a scenario where I want to maintain only the major version # within a go.mod file. Within this file I have a module directive like this:


where “3” represents the current major version of the package. I’d like to be able to configure bumpversion to bump this to “v4” when the next major version is created. It looks like I could maybe use a combination of the “parse” and “search” directives within a [bumpversion:file:...] section in my cfg file. Anyone done this before? It would be great if the README contained an example of this (after figuring this out, I would be happy to submit a PR for that). Thanks in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

florislacommented, Jan 10, 2020

I would go for #2 and move the examples to a separate file (or a repository folder) once we have more of them.

padamstxcommented, Jan 9, 2020

@florisla I’m ready to add a “go.mod” example to the project’s README file. I think there are two options for this:

  1. add a brief example as part of the discussion around the parse option
  2. add a new paragraph underneath Using bumpversion in a script with heading something like Using bumpversion to maintain a go.mod file

I’m sort of leaning toward #2. Do you have a preference?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing a version number string to an associating value
I would use a function like this to make the version string comparable: function comparableValue(versionString) { const digits ...
Read more >
[QUESTION] Incorrect loose parsing of version? · Issue #164
I'm using the semver.valid() function (with loose = true) to check if strings are possibly semantic versions and I've got an unexpected ...
Read more >
difference between soft parse and hard parse - Ask TOM
We want to be SOFT parsing at the system level (that means our applications as a whole make use of shared sql). That...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >
Compare two Version numbers
We need to compare them and conclude which one is the latest version number (that is, which version number is greater). Example: Input:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found