MCPcopy
hub / github.com/cli/cli / PrCheckStatusSummaryWithColor

Function PrCheckStatusSummaryWithColor

pkg/cmd/pr/shared/display.go:85–101  ·  view source on GitHub ↗
(cs *iostreams.ColorScheme, checks api.PullRequestChecksStatus)

Source from the content-addressed store, hash-verified

83}
84
85func PrCheckStatusSummaryWithColor(cs *iostreams.ColorScheme, checks api.PullRequestChecksStatus) string {
86 var summary = cs.Muted("No checks")
87 if checks.Total > 0 {
88 if checks.Failing > 0 {
89 if checks.Failing == checks.Total {
90 summary = cs.Red("× All checks failing")
91 } else {
92 summary = cs.Redf("× %d/%d checks failing", checks.Failing, checks.Total)
93 }
94 } else if checks.Pending > 0 {
95 summary = cs.Yellow("- Checks pending")
96 } else if checks.Passing == checks.Total {
97 summary = cs.Green("✓ Checks passing")
98 }
99 }
100 return summary
101}

Callers 3

printHumanPrPreviewFunction · 0.92
printPrsFunction · 0.92

Calls 5

MutedMethod · 0.80
RedMethod · 0.80
RedfMethod · 0.80
YellowMethod · 0.80
GreenMethod · 0.80

Tested by 1