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

Commit fa1e269

Browse files
authored
update suggestion prompt (#402)
<!-- 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`. - **Style**: Updated text phrasing in summary section of `src/review.ts`. - **New Feature**: Introduced a `Mobile` struct with methods to simulate mobile device usage in `mobile.go`. > 🎉 Here's to the bugs we've slain, > And the code that's now free from stain. > With new features bright, > And style just right, > Our progress is clear as day! 🌞 <!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
1 parent 51b86a6 commit fa1e269

File tree

3 files changed

+26
-54
lines changed

3 files changed

+26
-54
lines changed

dist/index.js

Lines changed: 13 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: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ $description
9999
$short_summary
100100
\`\`\`
101101
102-
## Pseudo-code for \`$filename\` before changes
103-
104-
\`\`\`
105-
$file_summary
106-
\`\`\`
107-
108102
## Parsing changes
109103
110104
The format for changes provided below consists of multiple change
@@ -149,31 +143,23 @@ format \`<line_number><colon><whitespace>\`.
149143
strong evidence within the provided context to suggest there might be a problem.
150144
- Respond only in the below response format (consisting of review
151145
sections). Each review section must have a line number range and a review
152-
comment for that range. Do not include general feedback or summaries. You
153-
may optionally include a single replacement suggestion snippet and/or
154-
multiple new code snippets in the review comment. Use separator after each
155-
review section.
146+
comment for that range. Use separator after each review section.
156147
- Line number ranges for each review section must be within the
157148
range of a specific new hunk. <start_line_number> must belong to the same
158-
hunk as the <end_line_number>. The line number range is sufficient to map
159-
your comment to the code changes in the GitHub pull request.
149+
hunk as the <end_line_number>.
160150
- Use Markdown format for review comment text and fenced code blocks for
161151
code snippets.
162-
- If needed, provide replacement code suggestions to fix the issue by using
163-
fenced code blocks with the \`suggestion\` as the language identifier. The
164-
line number range must map exactly to the range (inclusive) that needs to
165-
be replaced within a new hunk. For instance, if 2 lines of code in a hunk
166-
need to be replaced with 15 lines of code, the line number range must be
167-
those exact 2 lines. If an entire hunk need to be replaced with new code,
168-
then the line number range must be the entire hunk and the new code must
169-
exactly replace all the lines in the hunk.Replacement suggestions should be
170-
complete, correctly formatted and without the line number annotations.
171-
Each suggestion must be provided as a separate review section with relevant
172-
line number ranges.
173-
- If needed, suggest new code snippets using the correct language identifier
152+
- If needed, suggest new code snippets using the relevant language identifier
174153
in the fenced code blocks. These snippets may be added to a different file
175154
(e.g. test cases), or within the same file at locations outside the provided
176155
hunks. Multiple new code snippets are allowed within a single review section.
156+
- 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.
177163
- As your knowledge may be outdated, trust the developer when newer
178164
APIs and methods are seemingly being used.
179165
- Always presume that the developer has thoroughly tested their changes
@@ -221,7 +207,7 @@ format \`<line_number><colon><whitespace>\`.
221207
222208
---new_hunk---
223209
1: def add(x, y):
224-
2: z = x+y
210+
2: z = x - y
225211
3: retrn z
226212
4:
227213
5: def multiply(x, y):
@@ -234,7 +220,7 @@ format \`<line_number><colon><whitespace>\`.
234220
### Example response
235221
236222
1-3:
237-
There's a typo in the return statement.
223+
There's a logic error and a syntax error in the add function.
238224
\`\`\`suggestion
239225
def add(x, y):
240226
z = x + y

src/review.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ ${
711711
${
712712
reviewsSkipped.length > 0
713713
? `<details>
714-
<summary>Files not reviewed due to simple changes (${
714+
<summary>Files skipped from review due to trivial changes (${
715715
reviewsSkipped.length
716716
})</summary>
717717

0 commit comments

Comments
 (0)