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

Function formatRawComment

pkg/cmd/pr/shared/comments.go:38–51  ·  view source on GitHub ↗
(comment Comment)

Source from the content-addressed store, hash-verified

36}
37
38func formatRawComment(comment Comment) string {
39 if comment.IsHidden() {
40 return ""
41 }
42 var b strings.Builder
43 fmt.Fprintf(&b, "author:\t%s\n", comment.AuthorLogin())
44 fmt.Fprintf(&b, "association:\t%s\n", strings.ToLower(comment.Association()))
45 fmt.Fprintf(&b, "edited:\t%t\n", comment.IsEdited())
46 fmt.Fprintf(&b, "status:\t%s\n", formatRawCommentStatus(comment.Status()))
47 fmt.Fprintln(&b, "--")
48 fmt.Fprintln(&b, comment.Content())
49 fmt.Fprintln(&b, "--")
50 return b.String()
51}
52
53func CommentList(io *iostreams.IOStreams, comments api.Comments, reviews api.PullRequestReviews, preview bool) (string, error) {
54 sortedComments := sortComments(comments, reviews)

Callers 1

RawCommentListFunction · 0.85

Calls 8

formatRawCommentStatusFunction · 0.85
IsHiddenMethod · 0.65
AuthorLoginMethod · 0.65
AssociationMethod · 0.65
IsEditedMethod · 0.65
StatusMethod · 0.65
ContentMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected