Skip to content

Commit

Permalink
Process whole output
Browse files Browse the repository at this point in the history
This commit modifies process_output to
process all the detected problems instead
of just the first one.

Fixes #2882
  • Loading branch information
areebbeigh committed Apr 9, 2019
1 parent fd5a5a7 commit 71ee34c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions bears/python/PycodestyleBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,22 @@ def create_arguments(
def process_output(self, output, filename, file):
if not output: # backwards compatible no results
return
result = re.match(OUTPUT_REGEX, output)
result = re.findall(OUTPUT_REGEX, output)
if not result: # backwards compatible no results
self.warn('{}: Unexpected output {}'.format(filename, output))
return
line, column, message, rule = result.groups()
if rule == 'E501':
aspect = LineLength('py')
else:
aspect = None
yield Result.from_values(
origin='{} ({})'.format(self.name, rule),
message=message,
file=filename,
line=int(line),
column=int(column),
aspect=aspect,
)

for line, column, message, rule in result:
if rule == 'E501':
aspect = LineLength('py')
else:
aspect = None

yield Result.from_values(
origin='{} ({})'.format(self.name, rule),
message=message,
file=filename,
line=int(line),
column=int(column),
aspect=aspect,
)

0 comments on commit 71ee34c

Please sign in to comment.