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

Commit 930a3e5

Browse files
authored
try multi-line comments (#117)
1 parent 30b7c4d commit 930a3e5

File tree

4 files changed

+255
-130
lines changed

4 files changed

+255
-130
lines changed

action.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ inputs:
9898
required: false
9999
description: 'The prompt for the whole pull request'
100100
default: |
101-
In this session, we will summarize a pull request and a diff alltogether.
102-
103-
The pull request has the title "$title" and the following description:
101+
GitHub pull request has the title "$title" and the following description:
104102
105103
```
106104
$description
@@ -151,7 +149,7 @@ inputs:
151149
required: false
152150
description: 'The prompt for each file'
153151
default: |
154-
The pull request has the title "$title" and the following description:
152+
GitHub pull request has the title "$title" and the following description:
155153
156154
```
157155
$description
@@ -172,29 +170,51 @@ inputs:
172170
Below is the format for diff patches. `---`
173171
separator is used between patches.
174172
175-
<line_number>:
173+
<start_line-end_line>:
174+
```diff
175+
<diff_hunk>
176+
```
176177
```text
177178
<review comments on patch, if any>
178179
```
179-
```diff
180-
<patch>
181-
```
182180
---
183181
...
184182
185183
Patches for review -
186184
187185
$patches
188186
189-
Your review for each patch should be the following format
190-
with `---` separator between review comments. Make sure
191-
to use the line numbers exactly as provided above:
187+
Your review must consist of comments in the following format
188+
with `---` separator between review comments. Any other
189+
commentary outside of this format will be ignored and will not
190+
be read by the parser. Your comments will be added as multi-line
191+
review comments in the GitHub pull request.
192192
193-
<line_number>:
194-
<review>
193+
<start_line-end_line>:
194+
<review comment>
195+
---
196+
<start_line-end_line>:
197+
<explain why suggestion makes sense>
198+
```suggestion
199+
<new code>
200+
```
195201
---
196202
...
197203
204+
You can comment or suggest code changes for any number
205+
of (sub) line ranges within the line ranges
206+
(start_line and end_line) as long as your line ranges are
207+
within the line ranges in the patches.
208+
When suggesting code changes, the line ranges provided by you should
209+
map to exact line ranges that you wish to replace in the code
210+
with your new code suggestion. For example, if you are suggesting
211+
to replace 2 lines in code then the example comment could be -
212+
100-101:
213+
```suggestion
214+
print "Hello world"
215+
end
216+
```
217+
198218
Reflect on the provided code at least 3 times to identify any bug risks
199219
or provide improvement suggestions in these patches.
200220
You will point out potential issues such as security, logic errors,
@@ -206,8 +226,7 @@ inputs:
206226
as-is, please include "LGTM!" (exact word) in your short
207227
review comment.
208228
209-
Your responses will be recorded as review comments on the
210-
pull request. Markdown format is preferred for your responses.
229+
Markdown format is preferred for your responses.
211230
comment:
212231
required: false
213232
description: 'Prompt for comment'
@@ -265,10 +284,6 @@ inputs:
265284
Please reply directly to the new comment (instead of suggesting
266285
a reply) and your reply will be posted as-is.
267286
268-
If the comment contains instructions/requests for you, please comply.
269-
For example, if the comment is asking you to generate documentation
270-
comments on the code, in your reply please generate the required code.
271-
272287
In your reply, please make sure to begin the reply by tagging the user
273288
with "@user".
274289
@@ -277,6 +292,17 @@ inputs:
277292
```
278293
$comment
279294
```
295+
296+
If the comment contains instructions/requests for you, please comply.
297+
For example, if the comment is asking you to generate documentation
298+
comments on the code, in your reply please generate the required code.
299+
Any code change suggestion in the response must be enclosed in fenced code
300+
blocks with the suggestion identifier and must be in the line range
301+
of diff hunk provided to you -
302+
<your comment to the user>
303+
```suggestion
304+
<change>
305+
```
280306
runs:
281307
using: 'node16'
282308
main: 'dist/index.js'

0 commit comments

Comments
 (0)