Skip to content

Commit

Permalink
Merge pull request #11 from freeedcom/try-to-improve-code-reviewer-ou…
Browse files Browse the repository at this point in the history
…tput

try to reduce amount of comment suggestions
  • Loading branch information
villesau authored Apr 23, 2023
2 parents b8580d7 + a2b6787 commit 012d1cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ function getBaseAndHeadShas(owner, repo, pull_number) {
});
}
function createPrompt(file, chunk, prDetails) {
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]
return `Your task is to review pull requests. Instructions:
- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]
- Do not give positive comments or compliments.
- NEVER suggest adding a comment explaining the code.
- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array.
- Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.

Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ async function getBaseAndHeadShas(
}

function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]
return `Your task is to review pull requests. Instructions:
- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]
- Do not give positive comments or compliments.
- NEVER suggest adding a comment explaining the code.
- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array.
- Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.
Review the following code diff in the file "${
file.to
Expand Down

0 comments on commit 012d1cd

Please sign in to comment.