-
Notifications
You must be signed in to change notification settings - Fork 0
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: update var names #17
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { Reviewer } from './reviewer'; | |
import { Options as Config } from './options'; | ||
import { cliCanRun } from './utils'; | ||
|
||
type CliOptions = { | ||
type o = { | ||
pr: number; | ||
repository: string; | ||
owner: string; | ||
|
@@ -20,7 +20,7 @@ type CliOptions = { | |
.requiredOption('-r, --repository <string>', 'Repository name to review') | ||
.requiredOption('-o, --owner <string>', 'Repository owner') | ||
.addOption(new Option('-m, --model <string>', 'OpenAI GPT model to use').choices(['gpt-3.5-turbo', 'gpt-4']).makeOptionMandatory(true)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name 'o' is not descriptive. Consider using a more descriptive name for the type, such as 'CliOptions'. |
||
.action(async (options: CliOptions) => { | ||
.action(async (options: o) => { | ||
if(cliCanRun()) { | ||
const config = new Config({ | ||
openaiApiBaseUrl: 'https://api.openai.com/v1', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,16 @@ export const SUPPORTED_ACTIONS = ['opened', 'labeled']; | |
export const SUPPORTED_FILE_EXTENSIONS = ['.js', '.ts', '.py', '.java']; | ||
|
||
export class Options { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable names 'openai_Api_Key' and 'openai_Api_Base_Url' do not follow the camelCase naming convention typically used in JavaScript. Consider renaming them to 'openaiApiKey' and 'openaiApiBaseUrl' respectively. |
||
openaiApiKey: string; | ||
openaiApiBaseUrl: string; | ||
openai_Api_Key: string; | ||
openai_Api_Base_Url: string; | ||
openaiModel: 'gpt-4' | 'gpt-3.5-turbo'; | ||
|
||
constructor(params: { | ||
openaiApiBaseUrl: string; | ||
openaiModel: string; | ||
}) { | ||
this.openaiApiKey = process.env.OPENAI_API_KEY!; | ||
this.openaiApiBaseUrl = params.openaiApiBaseUrl; | ||
this.openai_Api_Key = process.env.OPENAI_API_KEY!; | ||
this.openai_Api_Base_Url = params.openaiApiBaseUrl; | ||
this.openaiModel = Options.parseGptModel(params.openaiModel); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ export class Reviewer { | |
|
||
constructor(options: Options) { | ||
this.options = options; | ||
const model = createOpenAILanguageModel(options.openaiApiKey, options.openaiModel); | ||
const model = createOpenAILanguageModel(options.openai_Api_Key, options.openaiModel); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name 'openai_Api_Key' does not follow the camelCase naming convention. Consider renaming it to 'openaiApiKey'. |
||
const schema = fs.readFileSync(path.join(__dirname, 'commentArraySchema.ts'), 'utf8'); | ||
this.translator = createJsonTranslator<CommentArraySchema>(model, schema, 'CommentArraySchema'); | ||
} | ||
|
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.
The variable name 'o' is not descriptive. Consider using a more descriptive name for the type, such as 'CliOptions'.