MCPcopy
hub / github.com/cli/cli / printSummary

Function printSummary

pkg/cmd/pr/checks/output.go:69–92  ·  view source on GitHub ↗
(io *iostreams.IOStreams, counts checkCounts)

Source from the content-addressed store, hash-verified

67}
68
69func printSummary(io *iostreams.IOStreams, counts checkCounts) {
70 summary := ""
71 if counts.Failed+counts.Passed+counts.Skipping+counts.Pending > 0 {
72 if counts.Failed > 0 {
73 summary = "Some checks were not successful"
74 } else if counts.Pending > 0 {
75 summary = "Some checks are still pending"
76 } else if counts.Canceled > 0 {
77 summary = "Some checks were cancelled"
78 } else {
79 summary = "All checks were successful"
80 }
81
82 tallies := fmt.Sprintf("%d cancelled, %d failing, %d successful, %d skipped, and %d pending checks",
83 counts.Canceled, counts.Failed, counts.Passed, counts.Skipping, counts.Pending)
84
85 summary = fmt.Sprintf("%s\n%s", io.ColorScheme().Bold(summary), tallies)
86 }
87
88 if io.IsStdoutTTY() {
89 fmt.Fprintln(io.Out, summary)
90 fmt.Fprintln(io.Out)
91 }
92}
93
94func printTable(io *iostreams.IOStreams, checks []check) error {
95 var headers []string

Callers 1

checksRunFunction · 0.85

Calls 3

BoldMethod · 0.80
ColorSchemeMethod · 0.80
IsStdoutTTYMethod · 0.80

Tested by

no test coverage detected