Skip to content
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

Lenient parsing of not-quite-semver versions #142

Closed
kornelski opened this issue Oct 25, 2017 · 2 comments
Closed

Lenient parsing of not-quite-semver versions #142

kornelski opened this issue Oct 25, 2017 · 2 comments

Comments

@kornelski
Copy link
Contributor

I needed to parse versions of a library that has versions such as "0.7-beta" and "1.0". Because these versions aren't strictly semver syntax, I had to fudge it a bit by appending .0 as a fallback.

It's a bit weird to ask for non-semver parsing in a semver library, but maybe it's something you'd consider (I can imagine it might be useful in other cases, such as correcting user input that is supposed to be semver, but isn't).

Interface-wise perhaps ParseError could have a field with a best-effort parsed Version object.

@KodrAus
Copy link

KodrAus commented Oct 25, 2017

Hi! Don't mind me... Just linking issues.

This looks related to #128.

And if we wanted to add a field to ParseError then it would probably be good to solve #135 using a black-box structure that could expose this through a method.

@steveklabnik
Copy link
Contributor

I think I'd like to keep this crate in accordance with the spec. If I did add it, I would want it to be under a different api, like _lossy or something, and at that point, it could be in a separate crate.

Thank you, but I'm not going to take PRs for this.

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

No branches or pull requests

3 participants