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

Commit 45f132d

Browse files
authored
update prompts (#385)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI ``` **Documentation:** - Updated the instructions in `action.yml` to clarify the scope of code review. - Revised response instructions and formatting guidelines in `src/prompts.ts` to focus on significant concerns. > 🎉 Here's to the changes, small but mighty, > To clearer instructions, making reviews light and sprightly. > No more minor issues, only the grand, > For better code quality, we make our stand! 🚀 ``` <!-- end of auto-generated comment: release notes by openai -->
1 parent 7818adf commit 45f132d

File tree

3 files changed

+63
-45
lines changed

3 files changed

+63
-45
lines changed

action.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,12 @@ inputs:
162162
- Modularity
163163
- Complexity
164164
- Optimization
165+
- Best practices: DRY, SOLID, KISS
165166
166-
Refrain from commenting on minor code style issues, missing
167-
comments/documentation, or giving compliments, unless explicitly
168-
requested. Concentrate on identifying and resolving significant
167+
Do not comment on minor code style issues, missing
168+
comments/documentation. Identify and resolve significant
169169
concerns to improve overall code quality while deliberately
170170
disregarding minor issues.
171-
172-
Other instructions:
173-
- As your knowledge may be outdated, trust the developer when newer
174-
APIs and methods are seemingly being used.
175-
- Always presume that the developer has thoroughly tested their changes
176-
and is aware of their implications on the entire system. Instead of
177-
making generic comments about potential impacts on the system, focus
178-
on providing specific, objective insights based on the code itself.
179-
- Do not question the developer's intention behind the changes or caution
180-
them to ensure that their modifications do not introduce compatibility
181-
issues with other dependencies.
182-
- Never ask the developer to review the changes.
183171
summarize:
184172
required: false
185173
description: 'The prompt for final summarization response'

dist/index.js

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

src/prompts.ts

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,50 +124,65 @@ hunk is of the format \`<line_number><colon><whitespace>\`.
124124
---end_change_section---
125125
...
126126
127-
## Response Instructions
127+
## IMPORTANT: Response Instructions
128128
129129
- Your task is to review ONLY the new hunks line by line, ONLY pointing out
130130
substantive issues within line number ranges. Provide the exact line
131131
number range (inclusive) for each issue. Take into account any supplementary
132132
context from the old hunks, comment threads, and file contents during your
133-
review process. Concentrate on pinpointing particular problems, and refrain
134-
from offering summaries of changes, general feedback, or praise for
135-
exceptional work.
133+
review process.
136134
- Understand that the hunk provided for review is a part of a larger codebase
137135
and may not include all relevant parts, such as definitions, imports, or uses
138136
of functions or variables. You may see incomplete fragments of code or
139137
references to elements defined outside the provided context. Refrain from
140138
flagging issues about missing definitions, imports, or uses unless there is
141139
strong evidence within the provided context to suggest there might be a problem.
142-
- IMPORTANT: Respond only in the below response format (consisting of review
140+
- Respond only in the below response format (consisting of review
143141
sections). Each review section must have a line number range and a review
144142
comment for that range. Do not include general feedback or summaries. You
145143
may optionally include a single replacement suggestion snippet and/or
146-
multiple new code snippets in the review comment. Separate review sections
147-
using separators.
148-
- IMPORTANT: Line number ranges for each review section must be within the
144+
multiple new code snippets in the review comment. Use separator after each
145+
review section.
146+
- Line number ranges for each review section must be within the
149147
range of a specific new hunk. <start_line_number> must belong to the same
150148
hunk as the <end_line_number>. The line number range is sufficient to map
151149
your comment to the code changes in the GitHub pull request.
152150
- Use Markdown format for review comment text and fenced code blocks for
153-
code snippets. Do not annotate code snippets with line numbers.
151+
code snippets.
154152
- If needed, provide replacement code suggestions to fix the issue by using
155153
fenced code blocks with the \`suggestion\` as the language identifier. The
156154
line number range must map exactly to the range (inclusive) that needs to
157155
be replaced within a new hunk. For instance, if 2 lines of code in a hunk
158156
need to be replaced with 15 lines of code, the line number range must be
159157
those exact 2 lines. If an entire hunk need to be replaced with new code,
160158
then the line number range must be the entire hunk and the new code must
161-
exactly replace all the lines in the hunk.
162-
- Replacement suggestions should be complete, correctly formatted and without
163-
the line number annotations. Each suggestion must be provided as a separate
164-
review section with relevant line number ranges.
159+
exactly replace all the lines in the hunk.Replacement suggestions should be
160+
complete, correctly formatted and without the line number annotations.
161+
Each suggestion must be provided as a separate review section with relevant
162+
line number ranges.
165163
- If needed, suggest new code snippets using the correct language identifier
166164
in the fenced code blocks. These snippets may be added to a different file
167165
(e.g. test cases), or within the same file at locations outside the provided
168166
hunks. Multiple new code snippets are allowed within a single review section.
169-
- IMPORTANT: If there are no issues found on a line range, you must only
170-
respond with the text \`LGTM!\` for that line range in the review section.
167+
- As your knowledge may be outdated, trust the developer when newer
168+
APIs and methods are seemingly being used.
169+
- Always presume that the developer has thoroughly tested their changes
170+
and is aware of their implications on the entire system. Instead of
171+
making generic comments about potential impacts on the system, focus
172+
on providing specific, objective insights based on the code itself.
173+
- Do not repeat information that is already evident from the code or the pull
174+
request.
175+
- Do not provide summaries, explanations of changes, or offer
176+
compliments for following good practices aboud code modifications that
177+
don't have any identifiable issue.
178+
- Do not question the developer's intention behind the changes or caution
179+
them to ensure that their modifications do not introduce compatibility
180+
issues with other dependencies.
181+
- Do not make presumptions about the larger impact outside the given context
182+
or the necessity of the changes.
183+
- Do not ask the developer to review the changes.
184+
- If there are no issues found on a line range, you MUST respond with the
185+
text \`LGTM!\` for that line range in the review section.
171186
- Reflect on your comments and line number ranges before sending the final
172187
response to ensure accuracy of line number ranges and replacement snippets.
173188

0 commit comments

Comments
 (0)