diff --git a/dist/index.js b/dist/index.js index feaa05b8..ddb4774c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6239,15 +6239,14 @@ Instructions: an old hunk, and optionally, existing comment chains. Note that the old hunk code has been replaced by the new hunk. The line number annotation on each line in the new hunk is of the format - \`\`. + \`\` , i.e. \`^*(\\d+): \`. - Your task is to review ONLY the new hunks line by line, ONLY pointing out substantive issues within line number ranges. Provide the exact line number range (inclusive) for each issue. Take into account any supplementary context from the old hunks, comment threads, and file contents during your review process. Concentrate on pinpointing particular problems, and refrain from offering summaries of changes, general feedback, or praise for - exceptional work. Additionally, avoid reiterating the provided code in your - review comments. + exceptional work. - IMPORTANT: Respond only in the response format (consisting of review sections). Each review section must have a line number range and a review comment for that range. Do not include general feedback or summaries. You @@ -6260,20 +6259,21 @@ Instructions: your comment to the code changes in the GitHub pull request. - Use Markdown format for review comment text and fenced code blocks for code snippets. Do not annotate code snippets with line numbers. -- If needed, provide replacement suggestions using fenced code blocks with the - \`suggestion\` language identifier. The line number range must map exactly - to the range (inclusive) that needs to be replaced within a new hunk. For - instance, if 2 lines of code in a hunk need to be replaced with 15 lines - of code, the line number range must be those exact 2 lines. If an entire - hunk need to be replaced with new code, then the line number range must - be the entire hunk. +- If needed, provide replacement code suggestions to fix the issue by using + fenced code blocks with the \`suggestion\` as the language identifier. The + line number range must map exactly to the range (inclusive) that needs to + be replaced within a new hunk. For instance, if 2 lines of code in a hunk + need to be replaced with 15 lines of code, the line number range must be + those exact 2 lines. If an entire hunk need to be replaced with new code, + then the line number range must be the entire hunk and the new code must + exactly replace all the lines in the hunk. - Replacement suggestions should be complete, correctly formatted and without the line number annotations. Each suggestion must be provided as a separate review section with relevant line number ranges. -- If needed, suggest new code using the correct language identifier in the - fenced code blocks. These snippets may be added to a different file, - such as test cases. Multiple new code snippets are allowed within a single - review section. +- If needed, suggest new code snippets using the correct language identifier in the + fenced code blocks. These snippets may be added to a different file + (e.g. test cases), or within the same file at locations outside the provided + hunks. Multiple new code snippets are allowed within a single review section. - If there are no substantive issues detected at a line range and/or the implementation looks good, you must respond with the comment "LGTM!" and nothing else for the respective line range in a review section. diff --git a/src/prompts.ts b/src/prompts.ts index 0ccdd27b..5764c973 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -94,15 +94,14 @@ Instructions: an old hunk, and optionally, existing comment chains. Note that the old hunk code has been replaced by the new hunk. The line number annotation on each line in the new hunk is of the format - \`\`. + \`\` , i.e. \`^*(\\d+): \`. - Your task is to review ONLY the new hunks line by line, ONLY pointing out substantive issues within line number ranges. Provide the exact line number range (inclusive) for each issue. Take into account any supplementary context from the old hunks, comment threads, and file contents during your review process. Concentrate on pinpointing particular problems, and refrain from offering summaries of changes, general feedback, or praise for - exceptional work. Additionally, avoid reiterating the provided code in your - review comments. + exceptional work. - IMPORTANT: Respond only in the response format (consisting of review sections). Each review section must have a line number range and a review comment for that range. Do not include general feedback or summaries. You @@ -115,20 +114,21 @@ Instructions: your comment to the code changes in the GitHub pull request. - Use Markdown format for review comment text and fenced code blocks for code snippets. Do not annotate code snippets with line numbers. -- If needed, provide replacement suggestions using fenced code blocks with the - \`suggestion\` language identifier. The line number range must map exactly - to the range (inclusive) that needs to be replaced within a new hunk. For - instance, if 2 lines of code in a hunk need to be replaced with 15 lines - of code, the line number range must be those exact 2 lines. If an entire - hunk need to be replaced with new code, then the line number range must - be the entire hunk. +- If needed, provide replacement code suggestions to fix the issue by using + fenced code blocks with the \`suggestion\` as the language identifier. The + line number range must map exactly to the range (inclusive) that needs to + be replaced within a new hunk. For instance, if 2 lines of code in a hunk + need to be replaced with 15 lines of code, the line number range must be + those exact 2 lines. If an entire hunk need to be replaced with new code, + then the line number range must be the entire hunk and the new code must + exactly replace all the lines in the hunk. - Replacement suggestions should be complete, correctly formatted and without the line number annotations. Each suggestion must be provided as a separate review section with relevant line number ranges. -- If needed, suggest new code using the correct language identifier in the - fenced code blocks. These snippets may be added to a different file, - such as test cases. Multiple new code snippets are allowed within a single - review section. +- If needed, suggest new code snippets using the correct language identifier in the + fenced code blocks. These snippets may be added to a different file + (e.g. test cases), or within the same file at locations outside the provided + hunks. Multiple new code snippets are allowed within a single review section. - If there are no substantive issues detected at a line range and/or the implementation looks good, you must respond with the comment "LGTM!" and nothing else for the respective line range in a review section.