mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 13:20:39 +08:00
update markdown
This commit is contained in:
@ -60,7 +60,7 @@ def unique_strings(input_list: List[str]) -> List[str]:
|
|||||||
return unique_list
|
return unique_list
|
||||||
|
|
||||||
|
|
||||||
def convert_to_markdown(output_data: dict, gfm_supported: bool = True) -> str:
|
def convert_to_markdown(output_data: dict, gfm_supported: bool = True, incremental_review=None) -> str:
|
||||||
"""
|
"""
|
||||||
Convert a dictionary of data into markdown format.
|
Convert a dictionary of data into markdown format.
|
||||||
Args:
|
Args:
|
||||||
@ -80,7 +80,11 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool = True) -> str:
|
|||||||
"Estimated effort to review [1-5]": "⏱️",
|
"Estimated effort to review [1-5]": "⏱️",
|
||||||
}
|
}
|
||||||
markdown_text = ""
|
markdown_text = ""
|
||||||
markdown_text += f"## PR Review\n\n"
|
if not incremental_review:
|
||||||
|
markdown_text += f"## PR Review\n\n"
|
||||||
|
else:
|
||||||
|
markdown_text += f"## Incremental PR Review\n\n"
|
||||||
|
markdown_text += f"⏮️ Review for commits since previous PR-Agent review {incremental_review}.\n\n"
|
||||||
if gfm_supported:
|
if gfm_supported:
|
||||||
markdown_text += "<table>\n<tr>\n"
|
markdown_text += "<table>\n<tr>\n"
|
||||||
# markdown_text += """<td> Feedback </td> <td></td></tr>"""
|
# markdown_text += """<td> Feedback </td> <td></td></tr>"""
|
||||||
|
@ -207,6 +207,7 @@ class PRReviewer:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
incremental_review_markdown_text = None
|
||||||
# Add incremental review section
|
# Add incremental review section
|
||||||
if self.incremental.is_incremental:
|
if self.incremental.is_incremental:
|
||||||
last_commit_url = f"{self.git_provider.get_pr_url()}/commits/" \
|
last_commit_url = f"{self.git_provider.get_pr_url()}/commits/" \
|
||||||
@ -216,12 +217,9 @@ class PRReviewer:
|
|||||||
if last_commit_msg:
|
if last_commit_msg:
|
||||||
replacement = last_commit_msg.splitlines(keepends=False)[0].replace('_', r'\_')
|
replacement = last_commit_msg.splitlines(keepends=False)[0].replace('_', r'\_')
|
||||||
incremental_review_markdown_text += f" \n_({replacement})_"
|
incremental_review_markdown_text += f" \n_({replacement})_"
|
||||||
data = OrderedDict(data)
|
|
||||||
data.update({'Incremental PR Review': {
|
|
||||||
"⏮️ Review for commits since previous PR-Agent review": incremental_review_markdown_text}})
|
|
||||||
data.move_to_end('Incremental PR Review', last=False)
|
|
||||||
|
|
||||||
markdown_text = convert_to_markdown(data, self.git_provider.is_supported("gfm_markdown"))
|
markdown_text = convert_to_markdown(data, self.git_provider.is_supported("gfm_markdown"),
|
||||||
|
incremental_review_markdown_text)
|
||||||
|
|
||||||
# Add help text if gfm_markdown is supported
|
# Add help text if gfm_markdown is supported
|
||||||
if self.git_provider.is_supported("gfm_markdown") and get_settings().pr_reviewer.enable_help_text:
|
if self.git_provider.is_supported("gfm_markdown") and get_settings().pr_reviewer.enable_help_text:
|
||||||
|
Reference in New Issue
Block a user