Skip to content

Commit

Permalink
fix log
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyW committed Sep 17, 2024
1 parent 3ec2ee4 commit 0a3bb3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions code_review/_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@

PR_DIFF_COMP_PROMPT = """
Below is the diff info from a github pull requests, please make a simple code review, and find the places that can be refined, in a simple and concise way. Please describe the refinement with no more than 100 words. And for the return message please follow the following rules:
1. if the code diff is like "VERSION=something", please ignore this change and do not return any review result, just return '';
2. if the code diff is like history notes, please just check the sentence grammar;
1. if the code diff is like "VERSION=something", please ignore this change and do not return any review result, just return Review-Ignored;
2. if the code diff is like history notes, please just check the sentence grammar, if no grammar error, please do not return anything;
3. if the help messages, notes, comments or examples contains '<>', please ensure it's surrounding html tags, if it's not, then please ensure it uses backtick to mark it as placeholder, if not, please pointed it out
4. if the help messages, comments contains url link, please help check whether the url link is accessible, if it's not accessible, please make sure it uses backtick to mark it as an fake url example, if not, pointed it out.
Please pay attention, do not say anything if the diff code follow above rules, nothing like 'Everything else looks good.' needs to be returned, just do not return anything
"""

PR_TAG = """
Expand Down
2 changes: 1 addition & 1 deletion code_review/pr_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __review_pr_code_line__(self, pr_diffs: dict[str, Any]) -> None:
format_gpt_message(messages, [PR_DIFF_COMP_PROMPT], role=MODEL_USER_ROLE)
format_gpt_message(messages, [patch], role=MODEL_USER_ROLE)
gpt_resp = self.gpt_manager.request_gpt(messages)
if not gpt_resp:
if not gpt_resp or gpt_resp == "Review-Ignored":
continue
review_item = {
"path": filename,
Expand Down
2 changes: 1 addition & 1 deletion code_review/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ def get_patch_position(patch_body: str) -> int | None:
if line.find("+") == 0:
found = True
if found and line.find("+") != 0:
return start
return start - 2

0 comments on commit 0a3bb3c

Please sign in to comment.