MCPcopy Create free account
hub / github.com/alibaba/open-code-review / formatComment

Function formatComment

scripts/github-actions/post-review-comments.js:1468–1478  ·  view source on GitHub ↗
(comment, id)

Source from the content-addressed store, hash-verified

1466// regex (unanchored, scans the whole body) still matches and the badge renders
1467// as the first visible line. The code suggestion block is appended if present.
1468function formatComment(comment, id) {
1469 let body = id ? `<!-- ${id} -->\n` : "";
1470 const badge = buildBadge(comment);
1471 if (badge) body += `${badge}\n`;
1472 body += comment.content || "";
1473 if (comment.suggestion_code && comment.existing_code) {
1474 body += "\n\n**Suggestion:**\n";
1475 body += fencedBlock(comment.suggestion_code, "suggestion");
1476 }
1477 return body;
1478}
1479
1480function formatCommentMarkdown(comment, error) {
1481 let md = "";

Callers 2

runPostReviewCommentsFunction · 0.85

Calls 2

fencedBlockFunction · 0.85
buildBadgeFunction · 0.70

Tested by 1