mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-28 20:14:14 +00:00
Rollback the latest changes
This commit is contained in:
parent
38e320dd5a
commit
4327a34010
3 changed files with 14 additions and 7 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -112,7 +112,10 @@ function createPrompt(file, chunk, prDetails) {
|
|||
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
|
||||
- Write the comment in GitHub Markdown format.
|
||||
- Use the given description only for the overall context and only comment the code.
|
||||
- Only return the most important issues.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
- IMPORTANT: Do not make suggestions related to code style.
|
||||
- IMPORTANT: Do not make suggestions related to TODO comments.
|
||||
|
||||
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
16
src/main.ts
16
src/main.ts
|
@ -85,10 +85,14 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
|||
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
|
||||
- Write the comment in GitHub Markdown format.
|
||||
- Use the given description only for the overall context and only comment the code.
|
||||
- Only return the most important issues.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
- IMPORTANT: Do not make suggestions related to code style.
|
||||
- IMPORTANT: Do not make suggestions related to TODO comments.
|
||||
|
||||
Review the following code diff in the file "${file.to
|
||||
}" and take the pull request title and description into account when writing the response.
|
||||
Review the following code diff in the file "${
|
||||
file.to
|
||||
}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
Pull request title: ${prDetails.title}
|
||||
Pull request description:
|
||||
|
@ -102,9 +106,9 @@ Git diff to review:
|
|||
\`\`\`diff
|
||||
${chunk.content}
|
||||
${chunk.changes
|
||||
// @ts-expect-error - ln and ln2 exists where needed
|
||||
.map((c) => `${c.ln ? c.ln : c.ln2} ${c.content}`)
|
||||
.join("\n")}
|
||||
// @ts-expect-error - ln and ln2 exists where needed
|
||||
.map((c) => `${c.ln ? c.ln : c.ln2} ${c.content}`)
|
||||
.join("\n")}
|
||||
\`\`\`
|
||||
`;
|
||||
}
|
||||
|
@ -187,7 +191,7 @@ async function main() {
|
|||
readFileSync(process.env.GITHUB_EVENT_PATH ?? "", "utf8")
|
||||
);
|
||||
|
||||
let actionNames: string[] = ["opened", "labeled", "reopened"]
|
||||
let actionNames: string[] = ["opened", "labeled", "reopened"];
|
||||
|
||||
if (actionNames.includes(eventData.action)) {
|
||||
diff = await getDiff(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue