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

Commit b9d27a8

Browse files
authored
Suggestions (#404)
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit --> ### Summary by CodeRabbit ## Release Notes - **Bug Fix**: Corrected logic and syntax errors in `add` function in `src/prompts.ts`. - **New Feature**: Added `multiply` function to `src/prompts.ts`. - **New Feature**: Introduced `subtract` function to `src/prompts.ts`. - **New Feature**: Created a `Mobile` struct with methods for operation and charging in `mobile.go`. > 🎉 Here's to the bugs we've squashed, > To the features newly launched. > With every line of code dispatched, > A better software patch is hatched! 🚀 <!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
1 parent fa1e269 commit b9d27a8

File tree

2 files changed

+78
-54
lines changed

2 files changed

+78
-54
lines changed

dist/index.js

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

src/prompts.ts

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,16 @@ format \`<line_number><colon><whitespace>\`.
138138
- Understand that the hunk provided for review is a part of a larger codebase
139139
and may not include all relevant parts, such as definitions, imports, or uses
140140
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
143143
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.
144151
- Respond only in the below response format (consisting of review
145152
sections). Each review section must have a line number range and a review
146153
comment for that range. Use separator after each review section.
@@ -154,29 +161,20 @@ format \`<line_number><colon><whitespace>\`.
154161
(e.g. test cases), or within the same file at locations outside the provided
155162
hunks. Multiple new code snippets are allowed within a single review section.
156163
- 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.
163172
- As your knowledge may be outdated, trust the developer when newer
164173
APIs and methods are seemingly being used.
165174
- Always presume that the developer has thoroughly tested their changes
166175
and is aware of their implications on the entire system. Instead of
167176
making generic comments about potential impacts on the system, focus
168177
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.
180178
- If there are no issues found on a line range, you MUST respond with the
181179
text \`LGTM!\` for that line range in the review section.
182180
- Reflect on your comments and line number ranges before sending the final
@@ -206,28 +204,42 @@ format \`<line_number><colon><whitespace>\`.
206204
### Example changes
207205
208206
---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
215219
216220
---old_hunk---
221+
z = x / y
222+
return z
223+
217224
def add(x, y):
218225
return x + y
226+
227+
def subtract(x, y):
228+
z = x - y
229+
230+
---end_change_section---
219231
220232
### Example response
221233
222-
1-3:
234+
15-17:
223235
There's a logic error and a syntax error in the add function.
224236
\`\`\`suggestion
225237
def add(x, y):
226238
z = x + y
227239
return z
228240
\`\`\`
229241
---
230-
5-6:
242+
19-20:
231243
LGTM!
232244
---
233245

0 commit comments

Comments
 (0)