Skip to content

Commit

Permalink
internal/cueexperiment: mark YAMLV3Decoder as deprecated too
Browse files Browse the repository at this point in the history
Just like the modules experiment, thanks to the recent patch by Roger.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Id9c2d0e7c28c23169fc040644930e4692fffb3ba
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200596
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
  • Loading branch information
mvdan committed Sep 9, 2024
1 parent e29900a commit f514f64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/cueexperiment/exp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Flags struct {
// with CUE_EXPERIMENT=yamlv3decoder=1 who must still suppport older CUE versions,
// but currently the feature is always enabled.
// TODO(mvdan): remove for v0.12.
YAMLV3Decoder bool `envflag:"default:true"`
YAMLV3Decoder bool `envflag:"deprecated,default:true"`

// EvalV3 enables the new evaluator. The new evaluator addresses various
// performance concerns.
Expand Down
6 changes: 2 additions & 4 deletions internal/cueexperiment/exp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ func TestInit(t *testing.T) {
qt.Assert(t, qt.IsTrue(Flags.Modules))
qt.Assert(t, qt.IsTrue(Flags.YAMLV3Decoder))

// Check that we can disable the YAML v3 experiment.
// Check that we cannot disable the YAML v3 experiment.
t.Setenv("CUE_EXPERIMENT", "yamlv3decoder=0")
err = initAlways()
qt.Assert(t, qt.IsNil(err))
qt.Assert(t, qt.IsTrue(Flags.Modules))
qt.Assert(t, qt.IsFalse(Flags.YAMLV3Decoder))
qt.Assert(t, qt.ErrorMatches(err, `cannot parse CUE_EXPERIMENT: cannot change default value of deprecated flag "yamlv3decoder"`))

// Check that we cannot disable the modules experiment.
t.Setenv("CUE_EXPERIMENT", "modules=0")
Expand Down

0 comments on commit f514f64

Please sign in to comment.