first commit
This commit is contained in:
23
tools/ai-review/comment.py
Normal file
23
tools/ai-review/comment.py
Normal file
@@ -0,0 +1,23 @@
|
||||
def to_markdown(result: dict) -> str:
|
||||
lines = []
|
||||
lines.append("## 🤖 Enterprise AI Code Review\n")
|
||||
lines.append(result.get("summary", "") + "\n")
|
||||
|
||||
if not result.get("issues"):
|
||||
lines.append("✅ No issues found.\n")
|
||||
else:
|
||||
for issue in result["issues"]:
|
||||
lines.append(f"### ❗ {issue['severity']} — {issue['category']}")
|
||||
lines.append(f"- **File:** `{issue['file']}`")
|
||||
if issue.get("line"):
|
||||
lines.append(f"- **Line:** `{issue['line']}`")
|
||||
lines.append(f"- **Issue:** {issue['description']}")
|
||||
lines.append(f"- **Recommendation:** {issue['recommendation']}\n")
|
||||
|
||||
lines.append("---")
|
||||
lines.append(f"**Overall severity:** `{result['overall_severity']}`")
|
||||
lines.append(
|
||||
"✅ **AI Approval**" if result.get("approval") else "❌ **Changes required**"
|
||||
)
|
||||
|
||||
return "\n".join(lines)
|
||||
Reference in New Issue
Block a user