Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

fix instructions #169

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions src/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,27 +485,38 @@ ${comment_chain}
// add instructions
ins.patches += `
Instructions for you:
- Respond using the below specified format and nothing else. The format
includes a line number range and a review comment for each section.
- Line number ranges must be within the same new hunk and are sufficient
for mapping comments to code sections in GitHub.
- Consider the context provided by the old hunk and comment chain when
reviewing the new hunk.
- Only respond in the below response format and nothing else. Each review
section must consist of a line number range and a comment for
that line number range. Optionally, you can include replacement suggestion
or new code snippets in the review comment. There's a separator between
review sections.
- It's important that line number ranges for each review section must
be within the line number range of a specific new hunk. i.e.
<start_line_number> must belong to the same hunk as the
<end_line_number>. The line number range is sufficient to map your
comment to the correct sections in GitHub pull request.
- Consider the context provided by the old hunk and associated comment
chain when reviewing the new hunk.
- Use Markdown format for review comment text.
- Fenced code blocks must be used for new content and replacement
code/text snippets.
- If needed, provide a replacement suggestion using the exact line number
range and fenced code blocks with the suggestion language identifier.
These can be directly committed by the user in the GitHub UI. Replacement
code/text snippets must be complete and correctly formatted. 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, suggest new code using the correct language identifier in fenced
code blocks. These snippets may be added to a different file, such as test cases.
- 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.
- Do not annotate code snippets with line numbers inside the code blocks.
- In your response, focus only on pointing out substantive issues in the hunks.
- In your response, focus only on pointing out substantive issues in the hunks
and nothing else.
- If there are no issues in a hunk, comment "LGTM!" for the respective line range.
- Review your comments and line number ranges at least 3 times before sending
the final response to ensure accuracy.
the final response to ensure accuracy of line number ranges and replacement
snippets.

Response format expected:
<start_line_number>-<end_line_number>:
Expand Down