Skip to content

Commit

Permalink
Refactor format_review_comment function to improve code readability a…
Browse files Browse the repository at this point in the history
…nd remove unnecessary HTML tags
  • Loading branch information
koganei committed Mar 9, 2024
1 parent d5d5617 commit 9f477e1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ def get_review(

def format_review_comment(summarized_review: str, chunked_reviews: List[str]) -> str:
"""Format reviews"""
s = summarized_review.replace('\n', '<br>')
if len(chunked_reviews) == 1:
return s
unioned_reviews = "<br>".join(chunked_reviews)
return summarized_review
unioned_reviews = "\n".join(chunked_reviews)
review = f"""
<h2>Summary</h2>
<pre>
# Summary
{summarized_review}
{s}
<hr>
<h2>Chunks</h2>
---
# Chunks
{unioned_reviews}
</pre>
"""
return review

Expand Down

0 comments on commit 9f477e1

Please sign in to comment.