minor fixes and cleanups
This commit is contained in:
parent
8e739e787a
commit
acd9c1e13f
5 changed files with 16 additions and 17 deletions
|
|
@ -39,6 +39,12 @@ def cleanup_file(fn):
|
|||
cleaned_texts = [cleanup_file(fn) for fn in fns]
|
||||
|
||||
if len(fns) == 2:
|
||||
print('\n'.join(unified_diff(*cleaned_texts)))
|
||||
"""
|
||||
chunk headers have trailing newlines, hence the rstrip()
|
||||
"""
|
||||
print(
|
||||
f'diff a/{fns[0]} b/{fns[1]}\n' +
|
||||
'\n'.join(a.rstrip() for a in unified_diff(*cleaned_texts,fromfile=f'a/{fns[0]}',tofile=f'b/{fns[1]}'))
|
||||
)
|
||||
else:
|
||||
print(f'{len(fns)} input files. Not generating diff.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue