(io *iostreams.IOStreams, pr *api.PullRequest)
| 162 | } |
| 163 | |
| 164 | func printRawPrPreview(io *iostreams.IOStreams, pr *api.PullRequest) error { |
| 165 | out := io.Out |
| 166 | cs := io.ColorScheme() |
| 167 | |
| 168 | reviewers := prReviewerList(*pr, cs) |
| 169 | assignees := prAssigneeList(*pr) |
| 170 | labels := prLabelList(*pr, cs) |
| 171 | projects := prProjectList(*pr) |
| 172 | |
| 173 | fmt.Fprintf(out, "title:\t%s\n", pr.Title) |
| 174 | fmt.Fprintf(out, "state:\t%s\n", prStateWithDraft(pr)) |
| 175 | fmt.Fprintf(out, "author:\t%s\n", pr.Author.DisplayName()) |
| 176 | fmt.Fprintf(out, "labels:\t%s\n", labels) |
| 177 | fmt.Fprintf(out, "assignees:\t%s\n", assignees) |
| 178 | fmt.Fprintf(out, "reviewers:\t%s\n", reviewers) |
| 179 | fmt.Fprintf(out, "projects:\t%s\n", projects) |
| 180 | var milestoneTitle string |
| 181 | if pr.Milestone != nil { |
| 182 | milestoneTitle = pr.Milestone.Title |
| 183 | } |
| 184 | fmt.Fprintf(out, "milestone:\t%s\n", milestoneTitle) |
| 185 | fmt.Fprintf(out, "number:\t%d\n", pr.Number) |
| 186 | fmt.Fprintf(out, "url:\t%s\n", pr.URL) |
| 187 | fmt.Fprintf(out, "additions:\t%s\n", cs.Green(strconv.Itoa(pr.Additions))) |
| 188 | fmt.Fprintf(out, "deletions:\t%s\n", cs.Red(strconv.Itoa(pr.Deletions))) |
| 189 | var autoMerge string |
| 190 | if pr.AutoMergeRequest == nil { |
| 191 | autoMerge = "disabled" |
| 192 | } else { |
| 193 | autoMerge = fmt.Sprintf("enabled\t%s\t%s", |
| 194 | pr.AutoMergeRequest.EnabledBy.Login, |
| 195 | strings.ToLower(pr.AutoMergeRequest.MergeMethod)) |
| 196 | } |
| 197 | fmt.Fprintf(out, "auto-merge:\t%s\n", autoMerge) |
| 198 | |
| 199 | fmt.Fprintln(out, "--") |
| 200 | fmt.Fprintln(out, pr.Body) |
| 201 | |
| 202 | return nil |
| 203 | } |
| 204 | |
| 205 | func printHumanPrPreview(opts *ViewOptions, baseRepo ghrepo.Interface, pr *api.PullRequest) error { |
| 206 | out := opts.IO.Out |
no test coverage detected