-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/load: add Config.AcceptLegacyModules
In some cases, we want to be able to accept legacy module files (module files lacking a major version) because there's no easy way to fix them by running `cue mod fix`. When running the cue command, `cue mod fix` should always be a possibility - the problem exists principally when using `cue/load` directly. We don't want to make this the default, because interpreting module files in this way is problematic, as it will discard fields that are legitimately part of the non-legacy module schema. So we add a boolean field that explicitly enables this behavior. Fixes #3219. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I24d66eb680be3267adbe0a972705cc3414936362 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196156 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196230 Reviewed-by: Paul Jolly <paul@myitcv.io>
- Loading branch information
Showing
4 changed files
with
89 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Note: no major version suffix. | ||
module: "test.example/foo" | ||
|
||
// Note: no language.version field present. | ||
|
||
// Note: extra field not allowed by later strict module versions. | ||
extraField: 124 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package foo | ||
|