MCPcopy Index your code
hub / github.com/cli/cli / renderPullRequestPlain

Function renderPullRequestPlain

pkg/cmd/pr/create/create.go:1080–1107  ·  view source on GitHub ↗
(w io.Writer, params map[string]interface{}, state *shared.IssueMetadataState)

Source from the content-addressed store, hash-verified

1078}
1079
1080func renderPullRequestPlain(w io.Writer, params map[string]interface{}, state *shared.IssueMetadataState) error {
1081 fmt.Fprint(w, "Would have created a Pull Request with:\n")
1082 fmt.Fprintf(w, "title:\t%s\n", params["title"])
1083 fmt.Fprintf(w, "draft:\t%t\n", params["draft"])
1084 fmt.Fprintf(w, "base:\t%s\n", params["baseRefName"])
1085 fmt.Fprintf(w, "head:\t%s\n", params["headRefName"])
1086 if len(state.Labels) != 0 {
1087 fmt.Fprintf(w, "labels:\t%v\n", strings.Join(state.Labels, ", "))
1088 }
1089 if len(state.Reviewers) != 0 {
1090 fmt.Fprintf(w, "reviewers:\t%v\n", strings.Join(state.Reviewers, ", "))
1091 }
1092 if len(state.Assignees) != 0 {
1093 fmt.Fprintf(w, "assignees:\t%v\n", strings.Join(state.Assignees, ", "))
1094 }
1095 if len(state.Milestones) != 0 {
1096 fmt.Fprintf(w, "milestones:\t%v\n", strings.Join(state.Milestones, ", "))
1097 }
1098 if len(state.ProjectTitles) != 0 {
1099 fmt.Fprintf(w, "projects:\t%v\n", strings.Join(state.ProjectTitles, ", "))
1100 }
1101 fmt.Fprintf(w, "maintainerCanModify:\t%t\n", params["maintainerCanModify"])
1102 fmt.Fprint(w, "body:\n")
1103 if len(params["body"].(string)) != 0 {
1104 fmt.Fprintln(w, params["body"])
1105 }
1106 return nil
1107}
1108
1109func renderPullRequestTTY(io *iostreams.IOStreams, params map[string]interface{}, state *shared.IssueMetadataState) error {
1110 cs := io.ColorScheme()

Callers 1

submitPRFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected