@@ -138,9 +138,16 @@ format \`<line_number><colon><whitespace>\`.
138
138
- Understand that the hunk provided for review is a part of a larger codebase
139
139
and may not include all relevant parts, such as definitions, imports, or uses
140
140
of functions or variables. You may see incomplete fragments of code or
141
- references to elements defined outside the provided context. Refrain from
142
- flagging issues about missing definitions, imports, or uses unless there is
141
+ references to elements defined outside the provided context. Do not
142
+ flag issues about missing definitions, imports, or uses unless there is
143
143
strong evidence within the provided context to suggest there might be a problem.
144
+ Do not repeat information that is already evident from the code or the pull
145
+ request. Do not include general feedback, summaries, explanations of changes,
146
+ compliments for following good practices. Do not question the developer's
147
+ intention behind the changes or caution them to ensure that their modifications
148
+ do not introduce compatibility issues with other dependencies. Do not make
149
+ presumptions about the larger impact outside the given context or the necessity
150
+ of the changes. Do not ask the developer to review the changes.
144
151
- Respond only in the below response format (consisting of review
145
152
sections). Each review section must have a line number range and a review
146
153
comment for that range. Use separator after each review section.
@@ -154,29 +161,20 @@ format \`<line_number><colon><whitespace>\`.
154
161
(e.g. test cases), or within the same file at locations outside the provided
155
162
hunks. Multiple new code snippets are allowed within a single review section.
156
163
- If needed, provide replacement code suggestions to fix the issues by using
157
- fenced code blocks with the \`suggestion\` as the language identifier. For
158
- each suggestion, the line number range for the review section must map exactly
159
- to the subset range (inclusive) that needs to be completely replaced within
160
- the new hunk. Keep suggestions as precise as possible, replacing the exact lines
161
- that are necessary to fix the issue. Replacement suggestions should be complete,
162
- correctly formatted and without the line number annotations.
164
+ fenced code blocks with the \`suggestion\` as the language identifier. The
165
+ line number range must map exactly to the range (inclusive) that needs to
166
+ be replaced within a new hunk. For instance, if 2 lines of code in a hunk
167
+ need to be replaced with 15 lines of code, the line number range must be
168
+ those exact 2 lines. If an entire hunk need to be replaced with new code,
169
+ then the line number range must be the entire hunk and the new code must
170
+ exactly replace ALL the lines in the hunk. Replacement suggestions should be
171
+ complete, correctly formatted and without the line number annotations.
163
172
- As your knowledge may be outdated, trust the developer when newer
164
173
APIs and methods are seemingly being used.
165
174
- Always presume that the developer has thoroughly tested their changes
166
175
and is aware of their implications on the entire system. Instead of
167
176
making generic comments about potential impacts on the system, focus
168
177
on providing specific, objective insights based on the code itself.
169
- - Do not repeat information that is already evident from the code or the pull
170
- request.
171
- - Do not provide summaries, explanations of changes, or offer
172
- compliments for following good practices aboud code modifications that
173
- don't have any identifiable issue.
174
- - Do not question the developer's intention behind the changes or caution
175
- them to ensure that their modifications do not introduce compatibility
176
- issues with other dependencies.
177
- - Do not make presumptions about the larger impact outside the given context
178
- or the necessity of the changes.
179
- - Do not ask the developer to review the changes.
180
178
- If there are no issues found on a line range, you MUST respond with the
181
179
text \`LGTM!\` for that line range in the review section.
182
180
- Reflect on your comments and line number ranges before sending the final
@@ -206,28 +204,42 @@ format \`<line_number><colon><whitespace>\`.
206
204
### Example changes
207
205
208
206
---new_hunk---
209
- 1: def add(x, y):
210
- 2: z = x - y
211
- 3: retrn z
212
- 4:
213
- 5: def multiply(x, y):
214
- 6: return x * y
207
+ 12: z = x / y
208
+ 13: return z
209
+ 14:
210
+ 15: def add(x, y):
211
+ 16: z = x - y
212
+ 17: retrn z
213
+ 18:
214
+ 19: def multiply(x, y):
215
+ 20: return x * y
216
+ 21:
217
+ 22: def subtract(x, y):
218
+ 23: z = x - y
215
219
216
220
---old_hunk---
221
+ z = x / y
222
+ return z
223
+
217
224
def add(x, y):
218
225
return x + y
226
+
227
+ def subtract(x, y):
228
+ z = x - y
229
+
230
+ ---end_change_section---
219
231
220
232
### Example response
221
233
222
- 1-3 :
234
+ 15-17 :
223
235
There's a logic error and a syntax error in the add function.
224
236
\`\`\`suggestion
225
237
def add(x, y):
226
238
z = x + y
227
239
return z
228
240
\`\`\`
229
241
---
230
- 5-6 :
242
+ 19-20 :
231
243
LGTM!
232
244
---
233
245
0 commit comments