Skip to content

Commit

Permalink
fix(writeout_unidiff): notify about missing newline
Browse files Browse the repository at this point in the history
Print 'diff'-like message about missing newline.
Previously if .result file was missing a newline the output would be the
following:

[047]  ---
[047] -...+...
[047]

After this patch:

[047]  ---
[047] -...
[047] \ No newline
[047] +...
[047]

Closes #212
  • Loading branch information
VifleY authored and Totktonada committed Jun 10, 2020
1 parent 1152183 commit d920322
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/colorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ def __call__(self, *args, **kwargs):

def writeout_unidiff(self, diff):
for i in diff:

if not i.endswith('\n'):
i += "\n\\ No newline\n"

if i.startswith('+'):
self.write(i, schema='diff_in')
elif i.startswith('-'):
Expand Down

0 comments on commit d920322

Please sign in to comment.