Add unicode to pr status

This commit is contained in:
Amanda Pinsker 2020-03-19 10:33:34 -07:00
parent 2660561ed9
commit ef17aa520d

View file

@ -412,28 +412,28 @@ func printPrs(w io.Writer, totalCount int, prs ...api.PullRequest) {
var summary string
if checks.Failing > 0 {
if checks.Failing == checks.Total {
summary = utils.Red("All checks failing")
summary = utils.Red("× All checks failing")
} else {
summary = utils.Red(fmt.Sprintf("%d/%d checks failing", checks.Failing, checks.Total))
}
} else if checks.Pending > 0 {
summary = utils.Yellow("Checks pending")
} else if checks.Passing == checks.Total {
summary = utils.Green("Checks passing")
summary = utils.Green("Checks passing")
}
fmt.Fprintf(w, " - %s", summary)
fmt.Fprintf(w, "%s", summary)
}
if reviews.ChangesRequested {
fmt.Fprintf(w, " - %s", utils.Red("Changes requested"))
fmt.Fprintf(w, "%s", utils.Red("+ Changes requested"))
} else if reviews.ReviewRequired {
fmt.Fprintf(w, " - %s", utils.Yellow("Review required"))
fmt.Fprintf(w, "%s", utils.Yellow("- Review required"))
} else if reviews.Approved {
fmt.Fprintf(w, " - %s", utils.Green("Approved"))
fmt.Fprintf(w, "%s", utils.Green("Approved"))
}
} else {
s := strings.Title(strings.ToLower(pr.State))
fmt.Fprintf(w, " - %s", prStateColorFunc(s))
fmt.Fprintf(w, "%s", prStateColorFunc(s))
}
fmt.Fprint(w, "\n")