file_write: ensure newline before closing diff fence
This commit is contained in:
parent
ae37c322cb
commit
2f61f0ce3d
|
|
@ -23,6 +23,8 @@ def format_diff(path, old, new):
|
|||
diff = ''.join(difflib.unified_diff(old_lines, new_lines, fromfile=path, tofile=path))
|
||||
if not diff:
|
||||
return None
|
||||
if not diff.endswith('\n'):
|
||||
diff += '\n'
|
||||
return f"```diff\n{diff}```"
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
|
|
|
|||
Loading…
Reference in New Issue