Skip to content

Commit

Permalink
resolves #65
Browse files Browse the repository at this point in the history
This will remove the line "No objections from ..." when it is not relevant in PR review summary comments.

Also adds a 🎉 for approved PR reviews
  • Loading branch information
2bndy5 committed Feb 10, 2024
1 parent 788596b commit 361b21d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cpp_linter/rest_api/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def post_feedback(
)

if self.event_name == "pull_request" and (tidy_review or format_review):
self.post_review(files, tidy_advice, format_advice)
self.post_review(
files, tidy_advice, format_advice, tidy_review, format_review
)

if file_annotations:
self.make_annotations(files, format_advice, tidy_advice, style)
Expand Down Expand Up @@ -354,6 +356,8 @@ def post_review(
files: List[FileObj],
tidy_advice: List[TidyAdvice],
format_advice: List[FormatAdvice],
tidy_review: bool,
format_review: bool,
):
url = f"{self.api_url}/repos/{self.repo}/pulls/{self.event_payload['number']}"
response_buffer = self.session.get(url, headers=self.make_headers())
Expand Down Expand Up @@ -386,12 +390,13 @@ def post_review(
if patch:
body += f"\n<details><summary>Click here for the full {tool} patch"
body += f"</summary>\n\n\n```diff\n{patch}\n```\n\n\n</details>\n\n"
else:
elif (index and tidy_review) or (not index and format_review):
# only include this line if it is relevant.
body += f"No objections from {tool}.\n"
if total_changes:
event = "REQUEST_CHANGES"
else:
body += "\nGreat job!"
body += "\nGreat job! :tada:"
event = "APPROVE"
body += USER_OUTREACH
payload = {
Expand Down

0 comments on commit 361b21d

Please sign in to comment.