mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 05:40:38 +08:00
@ -163,34 +163,38 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool = True, increment
|
|||||||
|
|
||||||
|
|
||||||
def process_can_be_split(emoji, value):
|
def process_can_be_split(emoji, value):
|
||||||
# key_nice = "Can this PR be split?"
|
try:
|
||||||
key_nice = "Multiple PR themes"
|
# key_nice = "Can this PR be split?"
|
||||||
markdown_text = ""
|
key_nice = "Multiple PR themes"
|
||||||
if not value or isinstance(value, list) and len(value) == 1:
|
markdown_text = ""
|
||||||
value = "No"
|
if not value or isinstance(value, list) and len(value) == 1:
|
||||||
markdown_text += f"<tr><td> {emoji} <strong>{key_nice}</strong></td><td>\n\n{value}\n\n</td></tr>\n"
|
value = "No"
|
||||||
else:
|
markdown_text += f"<tr><td> {emoji} <strong>{key_nice}</strong></td><td>\n\n{value}\n\n</td></tr>\n"
|
||||||
number_of_splits = len(value)
|
else:
|
||||||
markdown_text += f"<tr><td rowspan={number_of_splits}> {emoji} <strong>{key_nice}</strong></td>\n"
|
number_of_splits = len(value)
|
||||||
for i, split in enumerate(value):
|
markdown_text += f"<tr><td rowspan={number_of_splits}> {emoji} <strong>{key_nice}</strong></td>\n"
|
||||||
title = split.get('title', '')
|
for i, split in enumerate(value):
|
||||||
relevant_files = split.get('relevant_files', [])
|
title = split.get('title', '')
|
||||||
if i == 0:
|
relevant_files = split.get('relevant_files', [])
|
||||||
markdown_text += f"<td><details><summary>\nSub-PR theme: <strong>{title}</strong></summary>\n\n"
|
if i == 0:
|
||||||
markdown_text += f"<hr>\n"
|
markdown_text += f"<td><details><summary>\nSub-PR theme:<br><strong>{title}</strong></summary>\n\n"
|
||||||
markdown_text += f"Relevant files:\n"
|
markdown_text += f"<hr>\n"
|
||||||
markdown_text += f"<ul>\n"
|
markdown_text += f"Relevant files:\n"
|
||||||
for file in relevant_files:
|
markdown_text += f"<ul>\n"
|
||||||
markdown_text += f"<li>{file}</li>\n"
|
for file in relevant_files:
|
||||||
markdown_text += f"</ul>\n\n</details></td></tr>\n"
|
markdown_text += f"<li>{file}</li>\n"
|
||||||
else:
|
markdown_text += f"</ul>\n\n</details></td></tr>\n"
|
||||||
markdown_text += f"<tr>\n<td><details><summary>\nSub-PR theme: <strong>{title}</strong></summary>\n\n"
|
else:
|
||||||
markdown_text += f"<hr>\n"
|
markdown_text += f"<tr>\n<td><details><summary>\nSub-PR theme:<br><strong>{title}</strong></summary>\n\n"
|
||||||
markdown_text += f"Relevant files:\n"
|
markdown_text += f"<hr>\n"
|
||||||
markdown_text += f"<ul>\n"
|
markdown_text += f"Relevant files:\n"
|
||||||
for file in relevant_files:
|
markdown_text += f"<ul>\n"
|
||||||
markdown_text += f"<li>{file}</li>\n"
|
for file in relevant_files:
|
||||||
markdown_text += f"</ul>\n\n</details></td></tr>\n"
|
markdown_text += f"<li>{file}</li>\n"
|
||||||
|
markdown_text += f"</ul>\n\n</details></td></tr>\n"
|
||||||
|
except Exception as e:
|
||||||
|
get_logger().exception(f"Failed to process can be split: {e}")
|
||||||
|
return ""
|
||||||
return markdown_text
|
return markdown_text
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,12 +113,12 @@ review:
|
|||||||
security_concerns: |
|
security_concerns: |
|
||||||
No
|
No
|
||||||
{%- if require_can_be_split_review %}
|
{%- if require_can_be_split_review %}
|
||||||
can_be_split: |
|
can_be_split:
|
||||||
- relevant_files:
|
- relevant_files:
|
||||||
- ...
|
|
||||||
- ...
|
|
||||||
title: ...
|
|
||||||
- ...
|
- ...
|
||||||
|
- ...
|
||||||
|
title: ...
|
||||||
|
- ...
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if num_code_suggestions > 0 %}
|
{%- if num_code_suggestions > 0 %}
|
||||||
code_feedback
|
code_feedback
|
||||||
|
Reference in New Issue
Block a user