diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index 88baaac5..2f0466c6 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -317,20 +317,19 @@ class PRDescription: return pr_body try: - pr_body += """\n| | Relevant Files """ - pr_body += "  " * 70 - pr_body += """|\n|-----------|-------------|\n""" + pr_body = "" + pr_body += "" + pr_body += """""" + pr_body += """""" for semantic_label in value.keys(): s_label = semantic_label.strip("'").strip('"') - if self.git_provider.is_supported("gfm_markdown"): - # pr_body += f"
{semantic_label['label']}\n\n" - pr_body += f"| **{s_label}** |
files:
""" list_tuples = value[semantic_label] + pr_body += f"""""" + pr_body += """
Relevant Files
{s_label}
{len(list_tuples)} files""" for filename, file_change_description in list_tuples: filename = filename.replace("'", "`") filename_publish = filename.split("/")[-1] - filename_publish = f"**{filename_publish}**" + filename_publish = f"{filename_publish}" diff_plus_minus = "" diff_files = self.git_provider.diff_files for f in diff_files: @@ -341,24 +340,72 @@ class PRDescription: break # try to add line numbers link to code suggestions + link = "" if hasattr(self.git_provider, 'get_line_link'): filename = filename.strip() link = self.git_provider.get_line_link(filename, relevant_line_start=-1) - if link: - diff_plus_minus = f"[{diff_plus_minus}]({link})" - diff_plus_minus = f" {diff_plus_minus}" - if diff_plus_minus: - filename_publish += diff_plus_minus - if self.git_provider.is_supported("gfm_markdown"): - pr_body += f"
{filename_publish}" - file_change_description = self._insert_br_after_x_chars(file_change_description) - if diff_plus_minus: - pr_body += f"
    Changes summary:
    **{file_change_description}**
" - else: - pr_body += f"
    Changes summary:
    **{file_change_description}**
" - if self.git_provider.is_supported("gfm_markdown"): - pr_body += "|\n" + file_change_description = self._insert_br_after_x_chars(file_change_description) + pr_body += f""" + + + +""" + pr_body += """
+
+ {filename_publish} {diff_plus_minus} +
    + Changes summary:
    + {file_change_description} +
+
+
""" + print(pr_body) + + + # pr_body += """\n| | Relevant Files """ + # pr_body += "  " * 70 + # pr_body += """|\n|-----------|-------------|\n""" + # for semantic_label in value.keys(): + # s_label = semantic_label.strip("'").strip('"') + # if self.git_provider.is_supported("gfm_markdown"): + # # pr_body += f"
{semantic_label['label']}\n\n" + # pr_body += f"| **{s_label}** |
files:
" + # if self.git_provider.is_supported("gfm_markdown"): + # pr_body += "
|\n" except Exception as e: get_logger().error(f"Error processing pr files to markdown {self.pr_id}: {e}") pass