Skip to content

Commit

Permalink
[code_review_tool_evaluator] Fix the CSV results
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaibmujahid committed Jul 18, 2024
1 parent 3784efd commit 714cd0e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/code_review_tool_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def main():

is_first_result = True
result_file = "code_review_tool_evaluator.csv"
result_columns = ["Review Request ID", "File", "Line"] + [
result_unique_columns = ["Review Request ID", "File", "Line", "Comment Number"]
result_all_columns = result_unique_columns + [
f"Comment ({variant_name})" for variant_name, _ in tool_variants
]

Expand All @@ -157,13 +158,16 @@ def main():
"Review Request ID": review_request_id,
"File": comment.filename,
"Line": comment.end_line,
"Comment Number": i + 1,
f"Comment ({variant_name})": comment.content,
}
for comment in comments
for i, comment in enumerate(comments)
)

df = pd.DataFrame(all_variants_results, columns=result_columns).groupby(
["Review Request ID", "File", "Line"]
df = (
pd.DataFrame(all_variants_results, columns=result_all_columns)
.groupby(result_unique_columns)
.first()
)
df.to_csv(
result_file,
Expand Down

0 comments on commit 714cd0e

Please sign in to comment.