Skip to content

Commit

Permalink
refactor: single suggestion per review section (coderabbitai#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
harjotgill authored Apr 12, 2023
1 parent dad19b8 commit 88faa9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions dist/index.js

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

19 changes: 11 additions & 8 deletions src/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,9 @@ Instructions for you:
- Only respond in the below response format (consisting of review
sections) 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.
you can include a single replacement suggestion snippet 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
Expand All @@ -512,12 +513,14 @@ Instructions for you:
- If needed, provide a replacement suggestion using fenced code blocks
with the \`suggestion\` as the language identifier. The line number range
in the review section must map exactly to the line number range (inclusive)
that need to be replaced within a new_hunk_for_review. These snippets will be
directly committed by the user using the GitHub UI. 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. Replacement code/text snippets must be complete and correctly formatted.
that need to be replaced within a new_hunk_for_review.
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.
- Replacement code/text snippets must be complete and correctly
formatted. Each replacement 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.
Expand Down

0 comments on commit 88faa9f

Please sign in to comment.