Add missing newline in extended patch and remove trailing whitespace

This commit is contained in:
mrT23
2024-08-11 18:49:28 +03:00
parent 12742ef499
commit 4c1c313031
2 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,7 @@ def extend_patch(original_file_str, patch_str, patch_extra_lines_before=0, patch
extended_start2 = start2
extended_size2 = size2
delta_lines = []
extended_patch_lines.append('')
extended_patch_lines.append(
f'@@ -{extended_start1},{extended_size1} '
f'+{extended_start2},{extended_size2} @@ {section_header}')

View File

@ -195,7 +195,7 @@ def pr_generate_extended_diff(pr_languages: list,
if not extended_patch:
get_logger().warning(f"Failed to extend patch for file: {file.filename}")
continue
full_extended_patch = f"\n\n## {file.filename}\n\n{extended_patch}\n"
full_extended_patch = f"\n\n## {file.filename}\n{extended_patch.rstrip()}\n"
if add_line_numbers_to_hunks:
full_extended_patch = convert_to_hunks_with_lines_numbers(extended_patch, file)