Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
mrT23 committed Dec 10, 2023
1 parent 654938f commit a247fc3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pr_agent/algo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str:
markdown_text += f"\n\n- **{emoji} Code feedback:**\n\n"
else:
markdown_text += f"- {emoji} **{key}:**\n\n"
for item in value:
for i, item in enumerate(value):
if isinstance(item, dict) and key.lower() == 'code feedback':
markdown_text += parse_code_suggestion(item, gfm_supported)
markdown_text += parse_code_suggestion(item, i, gfm_supported)
elif item:
markdown_text += f" - {item}\n"
if key.lower() == 'code feedback':
Expand All @@ -80,7 +80,7 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str:
return markdown_text


def parse_code_suggestion(code_suggestions: dict, gfm_supported: bool=True) -> str:
def parse_code_suggestion(code_suggestions: dict, i:int, gfm_supported: bool=True) -> str:
"""
Convert a dictionary of data into markdown format.
Expand All @@ -91,6 +91,8 @@ def parse_code_suggestion(code_suggestions: dict, gfm_supported: bool=True) -> s
str: A string containing the markdown formatted text generated from the input dictionary.
"""
markdown_text = ""
if i == 0:
markdown_text += "<hr>"
if gfm_supported and 'relevant line' in code_suggestions:
# markdown_text=markdown_text.strip()
markdown_text += '<table>'
Expand Down

0 comments on commit a247fc3

Please sign in to comment.