Skip to content

Commit f514f64

Browse files
committed
internal/cueexperiment: mark YAMLV3Decoder as deprecated too
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]>
1 parent e29900a commit f514f64

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

internal/cueexperiment/exp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Flags struct {
1919
// with CUE_EXPERIMENT=yamlv3decoder=1 who must still suppport older CUE versions,
2020
// but currently the feature is always enabled.
2121
// TODO(mvdan): remove for v0.12.
22-
YAMLV3Decoder bool `envflag:"default:true"`
22+
YAMLV3Decoder bool `envflag:"deprecated,default:true"`
2323

2424
// EvalV3 enables the new evaluator. The new evaluator addresses various
2525
// performance concerns.

internal/cueexperiment/exp_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ func TestInit(t *testing.T) {
2323
qt.Assert(t, qt.IsTrue(Flags.Modules))
2424
qt.Assert(t, qt.IsTrue(Flags.YAMLV3Decoder))
2525

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

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

0 commit comments

Comments
 (0)