diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 05a02163..20dd1106 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -190,7 +190,7 @@ func logAndReport(reporter *report.Reporter, message string, args ...any) { func explainFailedGenerateWorkflow(task *runnerv1.Task, log func(message string, args ...any), err error) error { for n, line := range strings.Split(string(task.WorkflowPayload), "\n") { - log("%d: %s", n+1, line) + log("%5d: %s", n+1, line) } log("Errors were found and although they tend to be cryptic the line number they refer to gives a hint as to where the problem might be.") for _, line := range strings.Split(err.Error(), "\n") { diff --git a/internal/app/run/runner_test.go b/internal/app/run/runner_test.go index 78348fc2..ae0470c9 100644 --- a/internal/app/run/runner_test.go +++ b/internal/app/run/runner_test.go @@ -23,7 +23,7 @@ func TestExplainFailedGenerateWorkflow(t *testing.T) { generateWorkflowError := errors.New("message 1\nmessage 2") err := explainFailedGenerateWorkflow(task, log, generateWorkflowError) assert.Error(t, err) - assert.Equal(t, "1: on: [push]\n2: jobs:\n3: \nErrors were found and although they tend to be cryptic the line number they refer to gives a hint as to where the problem might be.\nmessage 1\nmessage 2\n", logged) + assert.Equal(t, " 1: on: [push]\n 2: jobs:\n 3: \nErrors were found and although they tend to be cryptic the line number they refer to gives a hint as to where the problem might be.\nmessage 1\nmessage 2\n", logged) } func TestLabelUpdate(t *testing.T) {