feat: experiments logging improvements (#2049)

* feat: warn when enabling inactive experiments

* feat: TASK_ environment prefix

* feat: calculate experiment enabled/active instead of storing

* refactor: rename GetTaskVar to GetTaskEnv

* feat: experiments tests
This commit is contained in:
Pete Davison
2025-02-08 23:02:51 +00:00
committed by GitHub
parent be81885835
commit 6ce798e16c
12 changed files with 259 additions and 82 deletions

View File

@@ -69,7 +69,7 @@ func run() error {
}
if flags.Experiments {
return experiments.List(log)
return log.PrintExperiments()
}
if flags.Init {
@@ -109,6 +109,10 @@ func run() error {
dir = home
}
if err := experiments.Validate(); err != nil {
log.Warnf("%s\n", err.Error())
}
var taskSorter sort.TaskSorter
switch flags.TaskSort {
case "none":
@@ -154,9 +158,6 @@ func run() error {
if err != nil {
return err
}
if experiments.AnyVariables.Enabled {
log.Warnf("The 'Any Variables' experiment flag is no longer required to use non-map variable types. If you wish to use map variables, please use 'TASK_X_MAP_VARIABLES' instead. See https://github.com/go-task/task/issues/1585\n")
}
// If the download flag is specified, we should stop execution as soon as
// taskfile is downloaded