-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove any use of Regex in the Version.Parser module #6077
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
Conversation
lib/elixir/lib/version.ex
Outdated
| :error | ||
| end | ||
| end | ||
| destructure [version_with_pre, build_metadata], String.split(string, "+", parts: 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
[version_with_pre | build_metadata] = String.split(string, "+")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one + is allowed. I don't see the advantage of doing that :|
|
❤️ 💚 💙 💛 💜 |
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
| end | ||
| destructure [version_with_pre, build], String.split(string, "+", parts: 2) | ||
| destructure [version, pre], String.split(version_with_pre, "-", parts: 2) | ||
| destructure [major, minor, patch], String.split(version, ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a test case for "1.2.3.4"? I don't see how we catch this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed.
No description provided.