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

Function formatComment

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

Source from the content-addressed store, hash-verified

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

Callers 2

runPostReviewCommentsFunction · 0.85

Calls 2

fencedBlockFunction · 0.85
buildBadgeFunction · 0.70

Tested by 1