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

Function renderPullRequestPlain

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

Source from the content-addressed store, hash-verified

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

Callers 1

submitPRFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected