minor fixes and cleanups

This commit is contained in:
The MMGen Project 2021-10-06 21:08:02 +00:00
commit acd9c1e13f
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
5 changed files with 16 additions and 17 deletions

View file

@ -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.')