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

Commit 80dbff0

Browse files
authored
fix instructions (#169)
1 parent e0e844a commit 80dbff0

File tree

2 files changed

+42
-20
lines changed

2 files changed

+42
-20
lines changed

dist/index.js

Lines changed: 21 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/review.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,27 +485,38 @@ ${comment_chain}
485485
// add instructions
486486
ins.patches += `
487487
Instructions for you:
488-
- Respond using the below specified format and nothing else. The format
489-
includes a line number range and a review comment for each section.
490-
- Line number ranges must be within the same new hunk and are sufficient
491-
for mapping comments to code sections in GitHub.
492-
- Consider the context provided by the old hunk and comment chain when
493-
reviewing the new hunk.
488+
- Only respond in the below response format and nothing else. Each review
489+
section must consist of a line number range and a comment for
490+
that line number range. Optionally, you can include replacement suggestion
491+
or new code snippets in the review comment. There's a separator between
492+
review sections.
493+
- It's important that line number ranges for each review section must
494+
be within the line number range of a specific new hunk. i.e.
495+
<start_line_number> must belong to the same hunk as the
496+
<end_line_number>. The line number range is sufficient to map your
497+
comment to the correct sections in GitHub pull request.
498+
- Consider the context provided by the old hunk and associated comment
499+
chain when reviewing the new hunk.
494500
- Use Markdown format for review comment text.
501+
- Fenced code blocks must be used for new content and replacement
502+
code/text snippets.
495503
- If needed, provide a replacement suggestion using the exact line number
496504
range and fenced code blocks with the suggestion language identifier.
497505
These can be directly committed by the user in the GitHub UI. Replacement
498506
code/text snippets must be complete and correctly formatted. For instance,
499507
if 2 lines of code in a hunk need to be replaced with 15 lines of code,
500508
the line number range must be those exact 2 lines. If an entire hunk need to
501509
be replaced with new code, then the line number range must be the entire hunk.
502-
- If needed, suggest new code using the correct language identifier in fenced
503-
code blocks. These snippets may be added to a different file, such as test cases.
510+
- If needed, suggest new code using the correct language identifier in the
511+
fenced code blocks. These snippets may be added to a different file, such
512+
as test cases.
504513
- Do not annotate code snippets with line numbers inside the code blocks.
505-
- In your response, focus only on pointing out substantive issues in the hunks.
514+
- In your response, focus only on pointing out substantive issues in the hunks
515+
and nothing else.
506516
- If there are no issues in a hunk, comment "LGTM!" for the respective line range.
507517
- Review your comments and line number ranges at least 3 times before sending
508-
the final response to ensure accuracy.
518+
the final response to ensure accuracy of line number ranges and replacement
519+
snippets.
509520
510521
Response format expected:
511522
<start_line_number>-<end_line_number>:

0 commit comments

Comments
 (0)