Skip to content

try to reduce amount of comment suggestions #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2023

Conversation

villesau
Copy link
Owner

This should reduce the amount of comments that asks to add comments. Might also improve the overall quality of the review.

src/main.ts Outdated
@@ -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 job is to review pull requests. Instructions:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rephrasing the first sentence to: Your task is to review pull requests. for better clarity.

- 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace IMPORTANT: with Note: to maintain consistency with the tone of the instructions.

@@ -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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rephrasing the sentence to Your task is to review the pull requests. Instructions: for better clarity.

@villesau villesau merged commit 012d1cd into main Apr 23, 2023
DematteisGiacomo pushed a commit to DematteisGiacomo/ai-codereviewer that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant