(io *iostreams.IOStreams, pr *api.PullRequest)
| 139 | } |
| 140 | |
| 141 | func printRawPrPreview(io *iostreams.IOStreams, pr *api.PullRequest) error { |
| 142 | out := io.Out |
| 143 | cs := io.ColorScheme() |
| 144 | |
| 145 | reviewers := prReviewerList(*pr, cs) |
| 146 | assignees := prAssigneeList(*pr) |
| 147 | labels := prLabelList(*pr, cs) |
| 148 | projects := prProjectList(*pr) |
| 149 | |
| 150 | fmt.Fprintf(out, "title:\t%s\n", pr.Title) |
| 151 | fmt.Fprintf(out, "state:\t%s\n", prStateWithDraft(pr)) |
| 152 | fmt.Fprintf(out, "author:\t%s\n", pr.Author.DisplayName()) |
| 153 | fmt.Fprintf(out, "labels:\t%s\n", labels) |
| 154 | fmt.Fprintf(out, "assignees:\t%s\n", assignees) |
| 155 | fmt.Fprintf(out, "reviewers:\t%s\n", reviewers) |
| 156 | fmt.Fprintf(out, "projects:\t%s\n", projects) |
| 157 | var milestoneTitle string |
| 158 | if pr.Milestone != nil { |
| 159 | milestoneTitle = pr.Milestone.Title |
| 160 | } |
| 161 | fmt.Fprintf(out, "milestone:\t%s\n", milestoneTitle) |
| 162 | fmt.Fprintf(out, "number:\t%d\n", pr.Number) |
| 163 | fmt.Fprintf(out, "url:\t%s\n", pr.URL) |
| 164 | fmt.Fprintf(out, "additions:\t%s\n", cs.Green(strconv.Itoa(pr.Additions))) |
| 165 | fmt.Fprintf(out, "deletions:\t%s\n", cs.Red(strconv.Itoa(pr.Deletions))) |
| 166 | var autoMerge string |
| 167 | if pr.AutoMergeRequest == nil { |
| 168 | autoMerge = "disabled" |
| 169 | } else { |
| 170 | autoMerge = fmt.Sprintf("enabled\t%s\t%s", |
| 171 | pr.AutoMergeRequest.EnabledBy.Login, |
| 172 | strings.ToLower(pr.AutoMergeRequest.MergeMethod)) |
| 173 | } |
| 174 | fmt.Fprintf(out, "auto-merge:\t%s\n", autoMerge) |
| 175 | |
| 176 | fmt.Fprintln(out, "--") |
| 177 | fmt.Fprintln(out, pr.Body) |
| 178 | |
| 179 | return nil |
| 180 | } |
| 181 | |
| 182 | func printHumanPrPreview(opts *ViewOptions, baseRepo ghrepo.Interface, pr *api.PullRequest) error { |
| 183 | out := opts.IO.Out |
no test coverage detected