From 9e602662c61402ab741c19dfe3eaee8337ddafe8 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Wed, 2 Aug 2023 18:27:34 -0700 Subject: [PATCH] prompt updates (#414) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary by CodeRabbit **Refactor:** - Updated the instructions in the review template for providing replacement snippets. The new format uses `diff` instead of `suggestion`, enhancing clarity and consistency. > 🎉 Here's to the code that we refine, 🥂 > > With each pull request, it shines more divine. ✨ > > A tweak in the template, a small change indeed, 📝 > > But it guides us better, in our coding creed. 🚀 --- dist/index.js | 22 +++++++++++----------- src/prompts.ts | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dist/index.js b/dist/index.js index 15578e89..ffc36345 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6811,21 +6811,21 @@ the system. Use Markdown format for review comment text and fenced code blocks for code snippets. -If necessary, suggest new code snippets using the relevant language identifier in +If needed, suggest new code snippets using the relevant 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 necessary, provide a replacement snippet to fix an issue by using fenced code -blocks using the \`diff\` format, marking additions with \`+\` and deletions -with \`-\`. The line number range for the review section that includes the -replacement snippet must map exactly to the line number range that has to be -completely replaced within the new hunk. If less than 10 lines of the hunk have -to be replaced then you may alternatively use the \`suggestion\` format. You must -carefully include any lines of code that remain unchanged in the replacement -snippet to avoid issues when the replacement snippet is committed as-is. -Replacement snippet must be complete, correctly formatted & indented and -without the line number annotations. +If needed, provide a replacement snippet to fix an issue by using fenced code +blocks using the \`diff\` as the format, clearly marking the lines that need be +added or removed with \`+\` and \`-\` respectively. The line number range for +the review section that includes the replacement snippet must map exactly to the +line number range that has to be completely replaced within the new hunk. +If less than 10 lines of the hunk have to be replaced then you may alternatively +use the \`suggestion\` format. You must carefully include any lines of code that +remain unchanged in the replacement snippet to avoid issues when the replacement +snippet is committed as-is. Replacement snippet must be complete, correctly +formatted & indented and without the line number annotations. If there are no issues found on a line range, you MUST respond with the text \`LGTM!\` for that line range in the review section. diff --git a/src/prompts.ts b/src/prompts.ts index 09c291f3..c3b756d9 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -137,21 +137,21 @@ the system. Use Markdown format for review comment text and fenced code blocks for code snippets. -If necessary, suggest new code snippets using the relevant language identifier in +If needed, suggest new code snippets using the relevant 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 necessary, provide a replacement snippet to fix an issue by using fenced code -blocks using the \`diff\` format, marking additions with \`+\` and deletions -with \`-\`. The line number range for the review section that includes the -replacement snippet must map exactly to the line number range that has to be -completely replaced within the new hunk. If less than 10 lines of the hunk have -to be replaced then you may alternatively use the \`suggestion\` format. You must -carefully include any lines of code that remain unchanged in the replacement -snippet to avoid issues when the replacement snippet is committed as-is. -Replacement snippet must be complete, correctly formatted & indented and -without the line number annotations. +If needed, provide a replacement snippet to fix an issue by using fenced code +blocks using the \`diff\` as the format, clearly marking the lines that need be +added or removed with \`+\` and \`-\` respectively. The line number range for +the review section that includes the replacement snippet must map exactly to the +line number range that has to be completely replaced within the new hunk. +If less than 10 lines of the hunk have to be replaced then you may alternatively +use the \`suggestion\` format. You must carefully include any lines of code that +remain unchanged in the replacement snippet to avoid issues when the replacement +snippet is committed as-is. Replacement snippet must be complete, correctly +formatted & indented and without the line number annotations. If there are no issues found on a line range, you MUST respond with the text \`LGTM!\` for that line range in the review section.