MCPcopy Create free account
hub / github.com/cli/cli / renderPullRequestPlain

Function renderPullRequestPlain

pkg/cmd/pr/create/create.go:1163–1190  ·  view source on GitHub ↗
(w io.Writer, params map[string]any, state *shared.IssueMetadataState)

Source from the content-addressed store, hash-verified

1161}
1162
1163func renderPullRequestPlain(w io.Writer, params map[string]any, state *shared.IssueMetadataState) error {
1164 fmt.Fprint(w, "Would have created a Pull Request with:\n")
1165 fmt.Fprintf(w, "title:\t%s\n", params["title"])
1166 fmt.Fprintf(w, "draft:\t%t\n", params["draft"])
1167 fmt.Fprintf(w, "base:\t%s\n", params["baseRefName"])
1168 fmt.Fprintf(w, "head:\t%s\n", params["headRefName"])
1169 if len(state.Labels) != 0 {
1170 fmt.Fprintf(w, "labels:\t%v\n", strings.Join(state.Labels, ", "))
1171 }
1172 if len(state.Reviewers) != 0 {
1173 fmt.Fprintf(w, "reviewers:\t%v\n", strings.Join(state.Reviewers, ", "))
1174 }
1175 if len(state.Assignees) != 0 {
1176 fmt.Fprintf(w, "assignees:\t%v\n", strings.Join(state.Assignees, ", "))
1177 }
1178 if len(state.Milestones) != 0 {
1179 fmt.Fprintf(w, "milestones:\t%v\n", strings.Join(state.Milestones, ", "))
1180 }
1181 if len(state.ProjectTitles) != 0 {
1182 fmt.Fprintf(w, "projects:\t%v\n", strings.Join(state.ProjectTitles, ", "))
1183 }
1184 fmt.Fprintf(w, "maintainerCanModify:\t%t\n", params["maintainerCanModify"])
1185 fmt.Fprint(w, "body:\n")
1186 if len(params["body"].(string)) != 0 {
1187 fmt.Fprintln(w, params["body"])
1188 }
1189 return nil
1190}
1191
1192func renderPullRequestTTY(io *iostreams.IOStreams, params map[string]any, state *shared.IssueMetadataState) error {
1193 cs := io.ColorScheme()

Callers 1

submitPRFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected