mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2024-11-26 22:19:03 +00:00
remove duplicate deletion and addition signs
This commit is contained in:
parent
6293b88dcd
commit
30597b305c
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -105,8 +105,7 @@ function analyzeCode(parsedDiff, prDetails) {
|
||||
});
|
||||
}
|
||||
function createPrompt(file, chunk, prDetails) {
|
||||
return `
|
||||
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
|
||||
return `Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
Title: ${prDetails.title}
|
||||
|
||||
@ -120,12 +119,22 @@ Please provide comments and suggestions ONLY if there is something to improve, w
|
||||
|
||||
Diff to review:
|
||||
|
||||
---
|
||||
\`\`\`diff
|
||||
${chunk.content}
|
||||
${chunk.changes
|
||||
.map((c) => (c.type === "add" ? "+" : "-") + " " + c.content)
|
||||
.map((c) => {
|
||||
if (c.type === "add") {
|
||||
return "+ " + c.content;
|
||||
}
|
||||
else if (c.type === "del") {
|
||||
return "- " + c.content;
|
||||
}
|
||||
else {
|
||||
return " " + c.content;
|
||||
}
|
||||
})
|
||||
.join("\n")}
|
||||
---
|
||||
\`\`\`
|
||||
|
||||
Give the answer in following TSV format:
|
||||
line_number\treview_comment
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
11
src/main.ts
11
src/main.ts
@ -80,8 +80,7 @@ async function analyzeCode(
|
||||
}
|
||||
|
||||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
||||
return `
|
||||
Review the following code diff in the file "${
|
||||
return `Review the following code diff in the file "${
|
||||
file.to
|
||||
}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
@ -97,12 +96,10 @@ Please provide comments and suggestions ONLY if there is something to improve, w
|
||||
|
||||
Diff to review:
|
||||
|
||||
---
|
||||
\`\`\`diff
|
||||
${chunk.content}
|
||||
${chunk.changes
|
||||
.map((c) => (c.type === "add" ? "+" : "-") + " " + c.content)
|
||||
.join("\n")}
|
||||
---
|
||||
${chunk.changes.map((c) => c.content).join("\n")}
|
||||
\`\`\`
|
||||
|
||||
Give the answer in following TSV format:
|
||||
line_number\treview_comment
|
||||
|
Loading…
Reference in New Issue
Block a user