diff --git a/internal/taskfile/task.go b/internal/taskfile/task.go index 0bd63b26..1afcbfa3 100644 --- a/internal/taskfile/task.go +++ b/internal/taskfile/task.go @@ -9,7 +9,7 @@ type Task struct { Cmds []*Cmd Deps []*Dep Desc string - Details string + Summary string Sources []string Generates []string Status []string diff --git a/task.go b/task.go index 1e01f223..c47ec7f0 100644 --- a/task.go +++ b/task.go @@ -83,7 +83,7 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error { func (e *Executor) printTaskDetails(task string) { t := e.Taskfile.Tasks[task] - s := t.Details + s := t.Summary if s == "" { e.Logger.Errf("task: There is no detailed description for task: %s", task) return diff --git a/task_test.go b/task_test.go index ba3179d6..bbbd4d0e 100644 --- a/task_test.go +++ b/task_test.go @@ -555,20 +555,20 @@ func TestIncludesCallingRoot(t *testing.T) { } func TestDetailsParsing(t *testing.T) { - const dir = "testdata/details" + const dir = "testdata/summary" e := task.Executor{ Dir: dir, } assert.NoError(t, e.Setup()) - assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Details, "details of task-with-details - line 1\nline 2\nline 3\n") - assert.Equal(t, e.Taskfile.Tasks["other-task-with-details"].Details, "details of other-task-with-details") - assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Details, "") + assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Summary, "details of task-with-details - line 1\nline 2\nline 3\n") + assert.Equal(t, e.Taskfile.Tasks["other-task-with-details"].Summary, "details of other-task-with-details") + assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Summary, "") } func TestDetails(t *testing.T) { - const dir = "testdata/details" + const dir = "testdata/summary" var buff bytes.Buffer e := task.Executor{ diff --git a/testdata/details/Taskfile.yml b/testdata/summary/Taskfile.yml similarity index 90% rename from testdata/details/Taskfile.yml rename to testdata/summary/Taskfile.yml index fae4579b..bca2dca3 100644 --- a/testdata/details/Taskfile.yml +++ b/testdata/summary/Taskfile.yml @@ -2,7 +2,7 @@ version: 2 tasks: task-with-details: deps: [dependend-task-1,dependend-task-2] - details: | + summary: | details of task-with-details - line 1 line 2 line 3 @@ -25,12 +25,12 @@ tasks: - echo 'dependend-task-2 was executed' other-task-with-details: - details: details of other-task-with-details + summary: details of other-task-with-details cmds: - echo 'other-task-with-details was executed' task-with-description-containing-empty-line: - details: | + summary: | First line followed by empty line Last Line diff --git a/testdata/details/task-with-description-containing-empty-line.txt b/testdata/summary/task-with-description-containing-empty-line.txt similarity index 100% rename from testdata/details/task-with-description-containing-empty-line.txt rename to testdata/summary/task-with-description-containing-empty-line.txt diff --git a/testdata/details/task-with-details.txt b/testdata/summary/task-with-details.txt similarity index 100% rename from testdata/details/task-with-details.txt rename to testdata/summary/task-with-details.txt