-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod/module: allow versionless module path in CheckPath
In general, a canonical module path can omit the major version (implying `@v0`), but this was not reflected in the `module.CheckPath` function. Changing this behavior fixes `cue mod edit` to allow such module paths. It also changes some error messages, as reflected in the tests. Fixes #3262. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: Ic1d64bf13b9afc81da5281d320e61fa704a1a947 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197629 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
5 changed files
with
22 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
! exec cue mod init bad | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
invalid module name "bad": missing dot in first path element | ||
malformed module path "bad": missing dot in first path element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# TODO reduce error message redundancy | ||
|
||
! exec cue mod init bad.com@v2.2 | ||
cmp stderr want-stderr | ||
-- want-stderr -- | ||
invalid module name "bad.com@v2.2": malformed module path "bad.com@v2.2": path can contain major version only | ||
malformed module path "bad.com@v2.2": path can contain major version only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters