Update semver regex to not swallow trailing .#129
Update semver regex to not swallow trailing .#129peterhuene merged 1 commit intobytecodealliance:mainfrom
.#129Conversation
|
The tests are red because some test cases use a version of |
I think we should fix the test cases to use a valid semver , like |
|
Ah, correction. Those tests are meant to be invalid semvers. The tests are for the error message, and it looks like the new regex has changed that from to which is definitely a step backward! So a custom regex might be needed after all. |
|
Looking back, I think I left it the more generic regex and then did validation via the Perhaps we simply just slap a |
850d3db to
8491be7
Compare
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
8491be7 to
2ea2465
Compare
|
@peterhuene I think I have something that works - forgiving enough to allow invalid things in version positions so that better errors can be given later, but strict enough to consume dots only when within the regex. I've added a test case for the issue and everything passes locally so 🤞 |
peterhuene
left a comment
There was a problem hiding this comment.
Looks good, thanks for fixing this!
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [wac-graph](https://togithub.com/bytecodealliance/wac) | workspace.dependencies | minor | `0.3.0` -> `0.4.0` | --- ### Release Notes <details> <summary>bytecodealliance/wac (wac-graph)</summary> ### [`v0.4.0`](https://togithub.com/bytecodealliance/wac/releases/tag/v0.4.0) [Compare Source](https://togithub.com/bytecodealliance/wac/compare/v0.3.0...v0.4.0) #### What's Changed - docs: more generic command listing prose by [@​vados-cosmonic](https://togithub.com/vados-cosmonic) in [https://github.com/bytecodealliance/wac/pull/125](https://togithub.com/bytecodealliance/wac/pull/125) - Bump h2 from 0.4.3 to 0.4.5 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bytecodealliance/wac/pull/126](https://togithub.com/bytecodealliance/wac/pull/126) - Update semver regex to not swallow trailing `.` by [@​itowlson](https://togithub.com/itowlson) in [https://github.com/bytecodealliance/wac/pull/129](https://togithub.com/bytecodealliance/wac/pull/129) - Implicit import check during target validation by [@​rylev](https://togithub.com/rylev) in [https://github.com/bytecodealliance/wac/pull/130](https://togithub.com/bytecodealliance/wac/pull/130) #### New Contributors - [@​vados-cosmonic](https://togithub.com/vados-cosmonic) made their first contribution in [https://github.com/bytecodealliance/wac/pull/125](https://togithub.com/bytecodealliance/wac/pull/125) - [@​dependabot](https://togithub.com/dependabot) made their first contribution in [https://github.com/bytecodealliance/wac/pull/126](https://togithub.com/bytecodealliance/wac/pull/126) - [@​itowlson](https://togithub.com/itowlson) made their first contribution in [https://github.com/bytecodealliance/wac/pull/129](https://togithub.com/bytecodealliance/wac/pull/129) **Full Changelog**: bytecodealliance/wac@v0.3.0...v0.4.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/andrzejressel/pulumi-wasm).
Fixes #128.
The new regex is more complicated than
waclikely needs - for example, it includes capture groups that the lexer discards. The reason for choosing it was that it is suggested by the official semver site (https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string). Of course it can be trimmed back if necessary but that introduces the possibility of me messing it up... grin