Skip to content

Commit

Permalink
group errors on same line
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed May 5, 2023
1 parent 13d4799 commit c76bd7c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pytest_github_actions_annotate_failures/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,17 @@ def _try_parse_multi_error_string_message(workspace, filesystempath, longrepr):
if not all(matches):
return None

return [(int(match.group(1)), match.group(2)) for match in matches]
errors_per_line = {}

for match in matches:
line_no = int(match.group(1))
message = match.group(2)
if line_no not in errors_per_line:
errors_per_line[line_no] = message
else:
errors_per_line[line_no] += "\n" + message

return errors_per_line.items()


def _error_workflow_command(filesystempath, lineno, longrepr):
Expand Down

0 comments on commit c76bd7c

Please sign in to comment.