Skip to content

Commit

Permalink
[#110]: Add list of string to create_comment_for_output() that will e…
Browse files Browse the repository at this point in the history
…ventually be converted to set to avoid duplicates
  • Loading branch information
JacobDomagala committed Nov 19, 2023
1 parent c9287e9 commit 3336b97
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/run_static_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ def create_comment_for_output(
issues_found = 0
global CURRENT_COMMENT_LENGTH
global FILES_WITH_ISSUES
list_of_issues = []
per_issue_string = ""
output_string = ""
was_note = False
for line in tool_output:
Expand Down Expand Up @@ -432,14 +434,22 @@ def create_comment_for_output(
)

if check_for_char_limit(new_line):
output_string += new_line
CURRENT_COMMENT_LENGTH += len(new_line)
if not is_note:
issues_found += 1
if len(per_issue_string) > 0:
list_of_issues.append(per_issue_string)
per_issue_string = new_line
else:
per_issue_string += new_line

output_string += new_line
CURRENT_COMMENT_LENGTH += len(new_line)

else:
CURRENT_COMMENT_LENGTH = COMMENT_MAX_SIZE
return output_string, issues_found

output_string = ', '.join(set(list_of_issues))
debug_print(f"\nFinal output_string = \n{output_string}\n")
return output_string, issues_found

Expand Down

0 comments on commit 3336b97

Please sign in to comment.