-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat: move git commands out of review lambda #46
Conversation
LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/test/load/loadTestCodeSnippets.ts
Example: const generateCodeSnippet = async (testCase: TestCase, model: AIModel): Promise<string> => {
const prompt = generateCodeSnippetsPrompt.replace('{testCase}', JSON.stringify(testCase));
const modelResponse = await model.callModel(prompt);
return modelResponse.replace('```typescript', '').replace('```', '');
};
LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/prompt/filterFiles/filterFiles.ts
Example: export const filterFiles = (files: File[]): File[] => {
return files.filter(file => {
const ext = extname(file.fileName);
return supportedFiles.includes(ext) && !excludedKeywords.some(keyword => file.fileName.includes(keyword));
});
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/prompt/makeSlimmedFile.ts
Example: export const makeSlimmedFile = async (file: File, maxBatchSize: number): Promise<ReviewFile> => {
let changedLines: string = file.changedLines;
if (changedLines.length > maxBatchSize) {
changedLines = changedLines.slice(0, maxBatchSize);
}
const context = await generateContext(changedLines, maxBatchSize);
const prompt = `${slimmedContextPrompt}
{fileContent: ${changedLines}, context: ${context}}`;
return { fileName: file.fileName, fileContent: prompt };
}; 🔄🔍📝 Powered by Code Review GPT |
Test results summary:✅ [PASS] - Test case: Bad variable name SUMMARY: ✅ PASS: 4 - Tests Powered by Code Review GPT |
|
||
expect(result).toBeInstanceOf(Array); | ||
expect(result.length).toBeGreaterThan(0); | ||
console.log(result[0]); |
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.
Probs dont need to log
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.
Yep, forgot to remove it, thanks !
Closes #42