@@ -391,42 +391,26 @@ Format for changes:
391
391
...
392
392
393
393
Instructions:
394
- - Only respond in the below response format and nothing else. Each review
395
- section must consist of a line number range and a comment for
396
- that line number range. Optionally, you can include replacement suggestion
397
- or new code snippets in the review comment. There's a separator between
398
- review sections.
399
- - It's important that line number ranges for each review section must
400
- be within the line number range of a specific new hunk. i.e.
401
- <start_line_number> must belong to the same hunk as the
402
- <end_line_number>.
403
- - Do not repeat back the code being reviewed as the the line number range is
404
- sufficient to map your comment to the correct location in GitHub.
405
- - Markdown format is preferred for review comment text.
406
- - Fenced code blocks must be used for new content and replacement
407
- code/text snippets.
408
- - Replacement code/text snippets must be complete and correctly
409
- formatted. The line number range must map exactly to the line
410
- number range that need to be replaced within a new_hunk_for_review.
411
- E.g. if you are suggesting to replace 2 specific lines in a
412
- new_hunk_for_review with 10 lines of code, then the line number
413
- range must be exactly the 2 lines that need to be replaced.
414
- The replacement code/text snippet must use \`suggestion\` as the
415
- language identifier in the fenced code block. Replacement code
416
- suggestions can be directly committed by the user from the GitHub
417
- UI, replacing the code within new_hunk_for_review, that is why
418
- alignment of line number ranges is important.
419
- - New code/text snippets must use the correct language identifier
420
- in the fenced code block. You can use such snippets to suggest
421
- code that can be added in some other file, e.g. test cases.
422
- - Do not annotate snippets with line numbers inside the code blocks.
423
- - If there are no issues or suggestions and the hunk is acceptable as-is,
424
- your comment on the line ranges must include the word 'LGTM!'.
425
- - Reflect on the provided code and your review comments at least 3 times
426
- before sending the final response. Double check the line number ranges
427
- and the content of the review sections.
428
-
429
- Response format expected -
394
+ - Respond using the specified format, which includes a line number range and
395
+ a review comment for each section.
396
+ - Line number ranges must be within the same new hunk.
397
+ - Do not repeat the code being reviewed, as line number ranges are sufficient
398
+ for locating comments.
399
+ - Consider the context provided by the old hunk and comment chain when
400
+ reviewing the new hunk.
401
+ - Use Markdown format for review comments to improve readability.
402
+ - If needed, provide a replacement suggestion using the exact line number
403
+ range and fenced code blocks with the suggestion language identifier.
404
+ These can be directly committed by the user in the GitHub UI. Replacement
405
+ code/text snippets must be complete and correctly formatted.
406
+ - If needed, suggest new code using the correct language identifier in fenced
407
+ code blocks. These snippets may be added to a different file, such as test cases.
408
+ - Do not annotate code snippets with line numbers inside the code blocks.
409
+ - If there are no issues with a hunk, comment "LGTM!" for the respective line range.
410
+ - Review your comments and line number ranges at least 3 times before sending
411
+ the final response to ensure accuracy.
412
+
413
+ Response format expected:
430
414
<start_line_number>-<end_line_number>:
431
415
<review comment>
432
416
---
@@ -444,20 +428,29 @@ Response format expected -
444
428
---
445
429
...
446
430
431
+ Example request:
432
+ ---new_hunk_for_review---
433
+ 1: def add(x, y):
434
+ 2: z = x+y
435
+ 3: retrn z
436
+ 4:
437
+ 5: def multiply(x, y):
438
+ 6: return x * y
439
+
440
+ ---old_hunk_for_context---
441
+ def add(x, y):
442
+ return x + y
443
+
447
444
Example response:
448
- 1-5:
449
- LGTM!
450
- ---
451
- 6-6:
452
- replace the code on line 6 with the following
445
+ 3-3:
446
+ There's a typo in the return statement.
453
447
\`\`\`suggestion
454
- for i in range(10):
455
- print("Hello!")
456
- print("World!")
457
- exit(0)
448
+ return z
458
449
\`\`\`
459
450
---
460
-
451
+ 5-6:
452
+ LGTM!
453
+ ---
461
454
462
455
Hunks for review are below:
463
456
`
0 commit comments