You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #3689, it's stated that failing when CUE_EXPERIMENT contains unknown keys is a problem:
As @mpvl points out, this is potentially a problem, because being able to enable or disable a number of experiments across CUE versions - even if some very old or very new versions do not support them - is useful to compare behavior, such as when investigating or bisecting bugs.
However, it seems to me that this is only a problem in this specific kind of situation.
In most other situations, it's actually good that we fail on unknown keys because
setting CUE_EXPERIMENT indicates an intention and if something is misspelled,
that's almost certainly an error.
I suggest that when we want this kind of behaviour (not failing on unknown keys), we will always know that
we want this behaviour and are in a position to do something slightly different to work around the error.
I propose that we support a special syntax that indicates that a given key should not
result in an error when it's unknown. It would still result in an error if an invalid
value is specified for a key that is recognized.
Straw-man syntax: a ? after the key:
Examples:
# Do not fail if evalv3 is not recognized but _do_ fail if embed is not.
CUE_EXPERIMENT='evalv3?,embed=1'
# Do not fail if embed is not recognized, but _do_ fail if
# embed is recognized but is not allowed to be set to false.
CUE_EXPERIMENT='embed?=0'
We might also support a mode that allows unrecognized values for known keys too, say ??:
# Set embed to false or ignore if false is not allowed.
CUE_EXPERIMENT=`embed??=1`
The text was updated successfully, but these errors were encountered:
In #3689, it's stated that failing when CUE_EXPERIMENT contains unknown keys is a problem:
However, it seems to me that this is only a problem in this specific kind of situation.
In most other situations, it's actually good that we fail on unknown keys because
setting
CUE_EXPERIMENT
indicates an intention and if something is misspelled,that's almost certainly an error.
I suggest that when we want this kind of behaviour (not failing on unknown keys), we will always know that
we want this behaviour and are in a position to do something slightly different to work around the error.
I propose that we support a special syntax that indicates that a given key should not
result in an error when it's unknown. It would still result in an error if an invalid
value is specified for a key that is recognized.
Straw-man syntax: a
?
after the key:Examples:
We might also support a mode that allows unrecognized values for known keys too, say
??
:The text was updated successfully, but these errors were encountered: