Skip to content

Commit 133291f

Browse files
authored
cmd/boot: titleize some warnings output (#392)
1 parent acf92c8 commit 133291f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/boot/internal/engine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,12 @@ func TestApplyReportsWarningsAfterProgress(t *testing.T) {
532532
t.Fatal(err)
533533
}
534534
got := out.String()
535-
assertContains(t, got, "\x1b[33mwarnings:\x1b[0m", "colored warning report")
535+
assertContains(t, got, "\x1b[33mWarnings:\x1b[0m", "colored warning report")
536536
assertContains(t, got, "It reported \x1b[33m2 warnings\x1b[0m.", "warning count")
537537
assertContains(t, got, "orphaned packages found:", "warning report")
538538
assertContains(t, got, " - oldlib", "warning report")
539539
assertContains(t, got, "reboot required", "warning report")
540-
if strings.Index(got, "Report:") > strings.Index(got, "warnings:") {
540+
if strings.Index(got, "Report:") > strings.Index(got, "Warnings:") {
541541
t.Fatalf("warnings were printed before the report:\n%s", got)
542542
}
543543
}

cmd/boot/internal/output.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ func (e *Engine) printWarnings(w io.Writer, warnings []warning) {
5858
if len(warnings) == 0 {
5959
return
6060
}
61-
fmt.Fprintf(w, "%s\n", e.color("warnings:", colorYellow))
61+
fmt.Fprintf(w, "%s\n", e.color("Warnings:", colorYellow))
6262
for _, warning := range warnings {
63-
fmt.Fprintf(w, "%s\n", e.color(fmt.Sprintf(" task: %s (%s)", warning.TaskID, warning.TaskName), colorYellow))
64-
fmt.Fprintf(w, "%s\n", e.color(" action: "+warning.Action, colorYellow))
63+
fmt.Fprintf(w, "%s\n", e.color(fmt.Sprintf(" Task: %s (%s)", warning.TaskID, warning.TaskName), colorYellow))
64+
fmt.Fprintf(w, "%s\n", e.color(" Action: "+warning.Action, colorYellow))
6565
lines := strings.Split(warning.Message, "\n")
66-
fmt.Fprintf(w, "%s\n", e.color(" warning: "+lines[0], colorYellow))
66+
fmt.Fprintf(w, "%s\n", e.color(" Warning: "+lines[0], colorYellow))
6767
for _, line := range lines[1:] {
6868
fmt.Fprintf(w, "%s\n", e.color(" "+line, colorYellow))
6969
}

0 commit comments

Comments
 (0)