add line number calculation instruction

This commit is contained in:
Ville Saukkonen 2023-03-28 01:45:50 +03:00
parent e73abe7ded
commit 27939a4b16
3 changed files with 5 additions and 5 deletions

4
dist/index.js vendored

@ -111,9 +111,9 @@ function createPrompt(file, chunk, prDetails) {
- Write the comment in GitHub markdown. - Write the comment in GitHub markdown.
- Don't give positive comments. - Don't give positive comments.
- Use the given description only for the overall context and only comment the code. - Use the given description only for the overall context and only comment the code.
- Calculate the line number from \`@@ -WW,XX +YY,ZZ @@\` using following formula: \`YY + L = line_number\`, where \`YY\` is the starting line number from the diff hunk, and \`L\` is the number of lines (including unchanged lines) from the starting line until the line you want to comment on. Pay special attention to this instruction and ensure that you count lines accurately.
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
Pull request title: ${prDetails.title} Pull request title: ${prDetails.title}
Pull request description: Pull request description:

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

@ -84,9 +84,9 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
- Write the comment in GitHub markdown. - Write the comment in GitHub markdown.
- Don't give positive comments. - Don't give positive comments.
- Use the given description only for the overall context and only comment the code. - Use the given description only for the overall context and only comment the code.
- Calculate the line number from \`@@ -WW,XX +YY,ZZ @@\` using following formula: \`YY + L = line_number\`, where \`YY\` is the starting line number from the diff hunk, and \`L\` is the number of lines (including unchanged lines) from the starting line until the line you want to comment on. Pay special attention to this instruction and ensure that you count lines accurately.
Review the following code diff in the file "${
Review the following code diff in the file "${
file.to file.to
}" and take the pull request title and description into account when writing the response. }" and take the pull request title and description into account when writing the response.