mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-10-01 04:25:49 +00:00
add ai review prompt example
This commit is contained in:
parent
d8bdc86e4f
commit
3fa884c562
6 changed files with 31 additions and 10 deletions
17
.github/ai-review-prompt.txt
vendored
Normal file
17
.github/ai-review-prompt.txt
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
Focus on the following code quality aspects during review:
|
||||
|
||||
1. **Error Handling**: Look for places where error handling could be more specific or robust. Flag any generic console.error() calls that could provide more context.
|
||||
|
||||
2. **Type Safety**: Identify any use of `any` types, missing type annotations, or places where TypeScript's strict checking could be improved.
|
||||
|
||||
3. **Function Complexity**: Flag functions that are longer than 20 lines or have more than 3 levels of nesting as potentially needing refactoring.
|
||||
|
||||
4. **Resource Management**: Look for file operations, API calls, or other resources that might not be properly handled or could benefit from better error recovery.
|
||||
|
||||
5. **Code Organization**: Suggest improvements to function organization, especially if constants or configuration could be better grouped.
|
||||
|
||||
6. **Performance**: Identify any obvious performance issues like unnecessary loops, redundant API calls, or inefficient data processing.
|
||||
|
||||
7. **Security**: Flag any potential security issues like unsafe string interpolation, missing input validation, or hardcoded values that should be configurable.
|
||||
|
||||
Be specific about line numbers and provide concrete suggestions for improvement. Focus only on actionable feedback that would improve code quality, maintainability, or reliability.
|
5
.github/workflows/code_review.yml
vendored
5
.github/workflows/code_review.yml
vendored
|
@ -12,9 +12,10 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Code Review
|
||||
uses: freeedcom/ai-codereviewer@main
|
||||
uses: smartconfigai/ai-codereviewer@main
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
OPENAI_API_MODEL: "gpt-4-1106-preview"
|
||||
OPENAI_API_MODEL: "gpt-4o-2024-08-06"
|
||||
system_prompt_path: ".github/ai-review-prompt.txt"
|
||||
exclude: "yarn.lock,dist/**"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue