mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 18:16:47 +00:00
Update dist
This commit is contained in:
parent
80b0b87381
commit
b7863cfd35
2 changed files with 8 additions and 9 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
@ -110,28 +110,27 @@ function createPrompt(file, chunk, prDetails) {
|
|||
const rules = core.getInput("rules");
|
||||
const rulesPrompt = rules === ""
|
||||
? ""
|
||||
: `Your review will only ensure the following rules are followed:
|
||||
${rules.replace(/\n/g, "\n- ")}`;
|
||||
const prompt = `Your name is ${botName}. Your task is to review pull requests. ${rulesPrompt}
|
||||
: `Your review will *only* ensure the following rules are followed:
|
||||
${rules}`;
|
||||
return `Your name is ${botName}. Your task is to review pull requests. ${rulesPrompt}
|
||||
|
||||
Here are your instructions regarding the format and the style of the review:
|
||||
- Provide the response in following JSON format: {"reviews": [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]}
|
||||
- Do not give positive comments or compliments.
|
||||
- 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.
|
||||
- You can suggest a fix in a reviewComment if you want to by using a \`\`\`suggestion\`\`\` code block.
|
||||
- You can suggest a fix in a reviewComment if you want to by using a \`\`\`suggestion\`\`\` code block (with proper whitespace indentation).
|
||||
- Use the given description only for the overall context and only comment the code.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
|
||||
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:
|
||||
|
||||
---
|
||||
${prDetails.description}
|
||||
---`;
|
||||
console.log(prompt);
|
||||
return `${prompt}
|
||||
---
|
||||
|
||||
Git diff to review:
|
||||
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue