-
Notifications
You must be signed in to change notification settings - Fork 169
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: configure option #14
Conversation
LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/args.ts This code is generally good, but there are areas for potential improvement.
Example: export const getYargs = async (inquirer = import("inquirer")) => {
// ...
if (!argv._[0]) {
const { default: inquirerModule } = await inquirer;
// ...
}
// ...
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/config.ts This code is generally good, but there are areas for potential improvement.
Example: if (!process.env.OPENAI_API_KEY) {
throw new Error("OPENAI_API_KEY is not set. Please set it in your .env file or in your environment variables.");
} LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/configure/index.ts This code is generally good, but there are areas for potential improvement.
Example: export const configure = async (fs = require("fs"), execSync = require("child_process").execSync) => {
// ...
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/index.ts This code is generally good, but there are areas for potential improvement.
Example: const commands = {
configure: async () => {
const { configure } = await import("./configure");
await configure();
},
review: async () => {
const { review } = await import("./review");
await review(argv);
},
};
const main = async () => {
const argv = await getYargs();
const command = commands[argv._[0]];
if (command) {
await command();
} else {
console.error("Unknown command");
process.exit(1);
}
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/askAI.ts This code is generally good, but there are areas for potential improvement.
Example: export const askAI = async (prompts: string[], console = global.console) => {
// ...
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/commentOnPR.ts This code is generally good, but there are areas for potential improvement.
Example: export const commentOnPR = async (comment: string) => {
try {
// ...
} catch (error) {
console.error(`Failed to comment on PR: ${error}`);
throw error;
}
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/constants.ts This code is generally good, but there are areas for potential improvement.
Example: const instruction1 = "As a senior developer, your task is to review a set of pull requests.";
const instruction2 = "You are given a list of filenames and their partial contents, but note that you might not have the full context of the code.";
// ...
export const instructionPrompt = instruction1 + "\n" + instruction2 + "\n" + // ... LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/constructPrompt.ts This code is generally good, but there are areas for potential improvement.
Example: export const constructPromptsArray = async (fileNames: string[]) => {
try {
// ...
} catch (error) {
console.error(`Failed to construct prompts array: ${error}`);
throw error;
}
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/getFileNames.ts This code is generally good, but there are areas for potential improvement.
Example: export const getFileNames = async (isCi: boolean) => {
try {
// ...
} catch (error) {
console.error(`Failed to get file names: ${error}`);
throw error;
}
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/index.ts This code is generally good, but there are areas for potential improvement.
Example: export const review = async (yargs: ReviewArgs) => {
try {
// ...
} catch (error) {
console.error(`Failed to review: ${error}`);
throw error;
}
}; LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/utils/build.js This code is generally good, but there are areas for potential improvement.
Example: build(sharedConfig).then(() => {
try {
// ...
} catch (error) {
console.error(`Failed to build: ${error}`);
throw error;
}
}); 🔨💡🧪 Powered by Code Review GPT |
with @fabienzucchet