mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
refactor: handle singular/plural forms of entry
This commit is contained in:
@ -281,12 +281,14 @@ def convert_to_markdown_v2(output_data: dict,
|
||||
markdown_todo_items = format_todo_items(value)
|
||||
EXPAND_LINE_THRESHOLD = 10
|
||||
details_open_attr = " open" if markdown_todo_items.count("\n") + 1 <= EXPAND_LINE_THRESHOLD else ""
|
||||
|
||||
todo_entry_label = f"{len(value)} " + "entries" if len(value) > 1 else "entry"
|
||||
if gfm_supported:
|
||||
markdown_text += "<tr><td>"
|
||||
if is_value_no(value):
|
||||
markdown_text += f"{emoji} <strong>No TODO sections</strong>"
|
||||
else:
|
||||
markdown_text += f"{emoji} <strong>TODO sections ({len(value)} items)</strong>\n"
|
||||
markdown_text += f"{emoji} <strong>TODO sections ({todo_entry_label})</strong>\n"
|
||||
markdown_text += f"<details{details_open_attr}><summary>{todos_summary}</summary>\n\n"
|
||||
markdown_text += markdown_todo_items
|
||||
markdown_text += "\n</details>\n"
|
||||
@ -295,7 +297,7 @@ def convert_to_markdown_v2(output_data: dict,
|
||||
if is_value_no(value):
|
||||
markdown_text += f"### {emoji} No TODO sections\n\n"
|
||||
else:
|
||||
markdown_text += f"### {emoji} TODO sections ({len(value)} items)\n<details{details_open_attr}><summary>{todos_summary}</summary>\n\n"
|
||||
markdown_text += f"### {emoji} TODO sections ({todo_entry_label})\n<details{details_open_attr}><summary>{todos_summary}</summary>\n\n"
|
||||
markdown_text += markdown_todo_items
|
||||
markdown_text += "\n</details>\n\n"
|
||||
elif 'can be split' in key_nice.lower():
|
||||
|
Reference in New Issue
Block a user