Skip to content

Commit

Permalink
Merge fc33c0d into db179e2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Feb 5, 2021
2 parents db179e2 + fc33c0d commit c2bd510
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions flake8_isort.py
Expand Up @@ -221,10 +221,22 @@ def run(self):
fromfile="{}:before".format(self.filename),
tofile="{}:after".format(self.filename)))
traceback = (isort_stdout.getvalue() + "\n" + diff_delta)
for line_num, message in self.isort_linenum_msg(diff_delta):
if self.show_traceback:
message += traceback
yield line_num, 0, message, type(self)
generator = (
(line_num, 0, message, type(self))
for (line_num, message) in self.isort_linenum_msg(diff_delta)
)

if self.show_traceback:
output = next(generator, None)
for next_output in generator:
yield output
output = next_output
else:
if output is not None:
message = output[2] + traceback
yield (*output[:2], message, *output[3:])
else:
yield from generator

def isort_linenum_msg(self, udiff):
"""Parse unified diff for changes and generate messages
Expand Down

0 comments on commit c2bd510

Please sign in to comment.