MCPcopy
hub / github.com/cli/cli / ColorForPRState

Function ColorForPRState

pkg/cmd/pr/shared/display.go:28–42  ·  view source on GitHub ↗
(pr api.PullRequest)

Source from the content-addressed store, hash-verified

26}
27
28func ColorForPRState(pr api.PullRequest) string {
29 switch pr.State {
30 case "OPEN":
31 if pr.IsDraft {
32 return "gray"
33 }
34 return "green"
35 case "CLOSED":
36 return "red"
37 case "MERGED":
38 return "magenta"
39 default:
40 return ""
41 }
42}
43
44func ColorForIssueState(issue api.Issue) string {
45 switch issue.State {

Callers 3

listRunFunction · 0.92
printPrsFunction · 0.92
StateTitleWithColorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected