-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the ai output #5
Conversation
- try to rephrase to be less positive
@@ -12,7 +12,7 @@ jobs: | |||
- name: Checkout repository | |||
uses: actions/checkout@v3 | |||
- name: Code Review | |||
uses: freeedcom/ai-codereviewer@main | |||
uses: freeedcom/ai-codereviewer@improve-the-AI-output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a specific version or commit hash instead of the branch name improve-the-AI-output
to ensure stability and reproducibility of the workflow.
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rephrasing this line to: - Avoid providing positive comments or compliments.
for better clarity.
src/main.ts
Outdated
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. | |||
- Do not suggest commenting on the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rephrasing this line to: - Refrain from suggesting to comment on the code.
for better clarity.
- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array. | ||
- Write the comment in GitHub markdown. | ||
- Don't give positive comments. | ||
- Use the given description only for the overall context and only comment the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to be removed, but it contains important information about calculating line numbers. Consider adding it back or incorporating the information into another part of the instructions.
src/main.ts
Outdated
${chunk.changes.map((c) => c.content).join("\n")} | ||
${chunk.changes | ||
// @ts-expect-error - ln and ln2 exists where needed | ||
.map((c) => `${c.ln ? `${c.ln} ` : `${c.ln2} `}${c.content}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a comment to explain the purpose of the @ts-expect-error
directive and why it's necessary in this case.
@@ -12,7 +12,7 @@ jobs: | |||
- name: Checkout repository | |||
uses: actions/checkout@v3 | |||
- name: Code Review | |||
uses: freeedcom/ai-codereviewer@main | |||
uses: freeedcom/ai-codereviewer@improve-the-AI-output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider pinning the action version to a specific release or commit instead of using the branch name improve-the-AI-output
. This ensures stability and prevents unexpected behavior changes in the future.
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rephrasing this line to: - Avoid giving positive comments or compliments.
for better clarity.
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. | |||
- Refrain from suggesting to comment on the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rephrasing this line to: - Avoid suggesting to comment on the code.
for better clarity.
- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array. | ||
- Write the comment in GitHub markdown. | ||
- Don't give positive comments. | ||
- Use the given description only for the overall context and only comment the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to be removed, but it contains important information about calculating the line number. Consider adding it back or incorporating the information in another part of the instructions.
src/main.ts
Outdated
${chunk.changes.map((c) => c.content).join("\n")} | ||
${chunk.changes | ||
// @ts-expect-error - ln and ln2 exists where needed | ||
.map((c) => `${c.ln ? `${c.ln} ` : `${c.ln2} `}${c.content}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a ternary operator instead of two separate string templates for better readability: ${c.ln ? c.ln : c.ln2} ${c.content}
.
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rephrasing the sentence to avoid using a double negative: 'Avoid giving positive comments or compliments.'
@@ -80,12 +80,12 @@ async function analyzeCode( | |||
|
|||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { | |||
return `- Provide the response in following JSON format: [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}] | |||
- Do not give positive comments or compliments. | |||
- Refrain from suggesting to comment on the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrase the sentence to make it clearer: 'Avoid suggesting to add comments to the code.'
- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array. | ||
- Write the comment in GitHub markdown. | ||
- Don't give positive comments. | ||
- Use the given description only for the overall context and only comment the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to be removed, but it contains important information about calculating line numbers. Consider keeping this instruction or incorporating it into another part of the prompt.
${chunk.changes.map((c) => c.content).join("\n")} | ||
${chunk.changes | ||
// @ts-expect-error - ln and ln2 exists where needed | ||
.map((c) => `${c.ln ? c.ln : c.ln2} ${c.content}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a comment to explain the purpose of this line and why the @ts-expect-error
is necessary.
…ocess Feat/revamp review process
upgrade openai package
This change should make the reviewer to mostly comment on the exactly correct lines and give less complinents.