From d2cc649db072e6731d0d6528e5274a5443c080eb Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 24 Mar 2023 13:03:25 -0700 Subject: [PATCH 1/5] separate config for max files to summarize and review --- action.yml | 9 +- src/main.ts | 3 +- src/options.ts | 9 +- src/review.ts | 364 ++++++++++++++++++++++++++++--------------------- 4 files changed, 222 insertions(+), 163 deletions(-) diff --git a/action.yml b/action.yml index 38099ef4..5e80e3fa 100644 --- a/action.yml +++ b/action.yml @@ -9,10 +9,15 @@ inputs: required: false description: 'Enable debug mode' default: 'false' - max_files: + max_files_to_summarize: + required: false + description: + 'Max files to summarize. Less than or equal to 0 means no limit.' + default: '60' + max_files_to_review: required: false description: 'Max files to review. Less than or equal to 0 means no limit.' - default: '50' + default: '180' review_comment_lgtm: required: false description: 'Leave comments even if the patch is LGTM' diff --git a/src/main.ts b/src/main.ts index 765c74ab..a1696c2a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,8 @@ import {codeReview} from './review.js' async function run(): Promise { const options: Options = new Options( core.getBooleanInput('debug'), - core.getInput('max_files'), + core.getInput('max_files_to_summarize'), + core.getInput('max_files_to_review'), core.getBooleanInput('review_comment_lgtm'), core.getMultilineInput('path_filters'), core.getInput('system_message'), diff --git a/src/options.ts b/src/options.ts index 48450aed..49e0dfb7 100644 --- a/src/options.ts +++ b/src/options.ts @@ -193,7 +193,8 @@ export class Inputs { export class Options { debug: boolean - max_files: number + max_files_to_summarize: number + max_files_to_review: number review_comment_lgtm: boolean path_filters: PathFilter system_message: string @@ -206,7 +207,8 @@ export class Options { constructor( debug: boolean, - max_files = '60', + max_files_to_summarize = '60', + max_files_to_review = '180', review_comment_lgtm = false, path_filters: string[] | null = null, system_message = '', @@ -217,7 +219,8 @@ export class Options { openai_concurrency_limit = '4' ) { this.debug = debug - this.max_files = parseInt(max_files) + this.max_files_to_summarize = parseInt(max_files_to_summarize) + this.max_files_to_review = parseInt(max_files_to_review) this.review_comment_lgtm = review_comment_lgtm this.path_filters = new PathFilter(path_filters) this.system_message = system_message diff --git a/src/review.ts b/src/review.ts index 33e6dbad..9987e7aa 100644 --- a/src/review.ts +++ b/src/review.ts @@ -66,34 +66,23 @@ export const codeReview = async ( } // skip files if they are filtered out - const filtered_files = [] - const skipped_files = [] + const filter_selected_files = [] + const filter_skipped_files = [] for (const file of files) { if (!options.check_path(file.filename)) { core.info(`skip for excluded path: ${file.filename}`) - skipped_files.push(file) + filter_skipped_files.push(file) } else { - filtered_files.push(file) + filter_selected_files.push(file) } } - // check if we are exceeding max_files and if max_files is <= 0 (no limit) - if (filtered_files.length > options.max_files && options.max_files > 0) { - core.warning("Skipped: too many files to review, can't handle it") - await commenter.comment( - `Skipped: too many files to review, can't handle it`, - SUMMARIZE_TAG, - 'replace' - ) - return - } - // find patches to review const filtered_files_to_review: ( | [string, string, string, [number, string][]] | null )[] = await Promise.all( - filtered_files.map(async file => { + filter_selected_files.map(async file => { // retrieve file contents let file_content = '' if (!context.payload.pull_request) { @@ -192,16 +181,24 @@ export const codeReview = async ( } return null } - const summaryPromises = files_to_review.map( - async ([filename, file_content, file_diff]) => - openai_concurrency_limit(async () => - generateSummary(filename, file_content, file_diff) + + const summaryPromises = [] + const skipped_files_to_summarize = [] + for (const [filename, file_content, file_diff] of files_to_review) { + if (summaryPromises.length < options.max_files_to_summarize) { + summaryPromises.push( + openai_concurrency_limit(async () => + generateSummary(filename, file_content, file_diff) + ) ) - ) + } else { + skipped_files_to_summarize.push(filename) + } + } const summaries = (await Promise.all(summaryPromises)).filter( summary => summary !== null - ) as [string, string][] + ) if (summaries.length > 0) { inputs.summary = '' @@ -223,25 +220,22 @@ ${filename}: ${summary} } else { inputs.summary = summarize_final_response - // make a bullet point list of skipped files - let skipped_files_str = '' - if (skipped_files.length > 0) { - skipped_files_str = `--- - -These files were skipped from the review: -` - for (const file of skipped_files) { - skipped_files_str += `- ${file.filename}\n` - } - } - const summarize_comment = `${summarize_final_response} -${skipped_files_str} +${ + filter_skipped_files.length > 0 + ? ` +--- + +### Skipped files +- ${filter_skipped_files.map(file => file.filename).join('\n- ')} +` + : '' +} --- -Tips: +### Tips - Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file. - Invite the bot into a review comment chain by tagging \`@openai\` in a reply. @@ -270,144 +264,200 @@ Tips: prompts.render_review_beginning(inputs), {} ) - // Use Promise.all to run file review processes in parallel - const reviewPromises = files_to_review.map( - async ([filename, file_content, file_diff, patches]) => - openai_concurrency_limit(async () => { - // reset chat session for each file while reviewing - let next_review_ids = review_begin_ids - - // make a copy of inputs - const ins: Inputs = inputs.clone() - - ins.filename = filename - - if (file_content.length > 0) { - ins.file_content = file_content - const file_content_tokens = tokenizer.get_token_count(file_content) - if (file_content_tokens < options.max_tokens_for_extra_content) { - try { - // review file - const [resp, review_file_ids] = await bot.chat( - prompts.render_review_file(ins), - next_review_ids - ) - if (!resp) { - core.info('review: nothing obtained from openai') - } else { - next_review_ids = review_file_ids - if (!resp.includes('LGTM')) { - // TODO: add file level comments via API once it's available - // See: https://github.blog/changelog/2023-03-14-comment-on-files-in-a-pull-request-public-beta/ - // For now comment on the PR itself - const tag = `` - const comment = `${tag}\nReviewing existing code in: ${filename}\n\n${resp}` - await commenter.comment(comment, tag, 'replace') - } - } - } catch (error) { - core.warning(`review: error from openai: ${error}`) - } + + const review = async ( + filename: string, + file_content: string, + file_diff: string, + patches: [number, string][] + ): Promise => { + // reset chat session for each file while reviewing + let next_review_ids = review_begin_ids + + // make a copy of inputs + const ins: Inputs = inputs.clone() + + ins.filename = filename + + if (file_content.length > 0) { + ins.file_content = file_content + const file_content_tokens = tokenizer.get_token_count(file_content) + if (file_content_tokens < options.max_tokens_for_extra_content) { + try { + // review file + const [resp, review_file_ids] = await bot.chat( + prompts.render_review_file(ins), + next_review_ids + ) + if (!resp) { + core.info('review: nothing obtained from openai') } else { - core.info( - `skip sending content of file: ${ins.filename} due to token count: ${file_content_tokens}` - ) + next_review_ids = review_file_ids + if (!resp.includes('LGTM')) { + // TODO: add file level comments via API once it's available + // See: https://github.blog/changelog/2023-03-14-comment-on-files-in-a-pull-request-public-beta/ + // For now comment on the PR itself + const tag = `` + const comment = `${tag}\nReviewing existing code in: ${filename}\n\n${resp}` + await commenter.comment(comment, tag, 'replace') + } } + } catch (error) { + core.warning(`review: error from openai: ${error}`) } + } else { + core.info( + `skip sending content of file: ${ins.filename} due to token count: ${file_content_tokens}` + ) + } + } - if (file_diff.length > 0) { - ins.file_diff = file_diff - const file_diff_tokens = tokenizer.get_token_count(file_diff) - if (file_diff_tokens < options.max_tokens_for_extra_content) { - try { - // review diff - const [resp, review_diff_ids] = await bot.chat( - prompts.render_review_file_diff(ins), - next_review_ids - ) - if (!resp) { - core.info('review: nothing obtained from openai') - } else { - next_review_ids = review_diff_ids - } - } catch (error) { - core.warning(`review: error from openai: ${error}`) - } + if (file_diff.length > 0) { + ins.file_diff = file_diff + const file_diff_tokens = tokenizer.get_token_count(file_diff) + if (file_diff_tokens < options.max_tokens_for_extra_content) { + try { + // review diff + const [resp, review_diff_ids] = await bot.chat( + prompts.render_review_file_diff(ins), + next_review_ids + ) + if (!resp) { + core.info('review: nothing obtained from openai') } else { - core.info( - `skip sending diff of file: ${ins.filename} due to token count: ${file_diff_tokens}` - ) + next_review_ids = review_diff_ids } + } catch (error) { + core.warning(`review: error from openai: ${error}`) } + } else { + core.info( + `skip sending diff of file: ${ins.filename} due to token count: ${file_diff_tokens}` + ) + } + } - // review_patch_begin - const [, patch_begin_ids] = await bot.chat( - prompts.render_review_patch_begin(ins), - next_review_ids + // review_patch_begin + const [, patch_begin_ids] = await bot.chat( + prompts.render_review_patch_begin(ins), + next_review_ids + ) + next_review_ids = patch_begin_ids + + for (const [line, patch] of patches) { + core.info(`Reviewing ${filename}:${line} with openai ...`) + ins.patch = patch + if (!context.payload.pull_request) { + core.warning('No pull request found, skipping.') + continue + } + + try { + // get existing comments on the line + const all_chains = await commenter.get_conversation_chains_at_line( + context.payload.pull_request.number, + filename, + line, + COMMENT_REPLY_TAG ) - next_review_ids = patch_begin_ids - - for (const [line, patch] of patches) { - core.info(`Reviewing ${filename}:${line} with openai ...`) - ins.patch = patch - if (!context.payload.pull_request) { - core.warning('No pull request found, skipping.') - continue - } - try { - // get existing comments on the line - const all_chains = - await commenter.get_conversation_chains_at_line( - context.payload.pull_request.number, - filename, - line, - COMMENT_REPLY_TAG - ) - - if (all_chains.length > 0) { - ins.comment_chain = all_chains - } else { - ins.comment_chain = 'no previous comments' - } - } catch (e: any) { - core.warning( - `Failed to get comments: ${e}, skipping. backtrace: ${e.stack}` - ) - } + if (all_chains.length > 0) { + ins.comment_chain = all_chains + } else { + ins.comment_chain = 'no previous comments' + } + } catch (e: any) { + core.warning( + `Failed to get comments: ${e}, skipping. backtrace: ${e.stack}` + ) + } - try { - const [response, patch_ids] = await bot.chat( - prompts.render_review_patch(ins), - next_review_ids - ) - if (!response) { - core.info('review: nothing obtained from openai') - continue - } - next_review_ids = patch_ids - if (!options.review_comment_lgtm && response.includes('LGTM')) { - continue - } - await commenter.review_comment( - context.payload.pull_request.number, - commits[commits.length - 1].sha, - filename, - line, - `${response}` - ) - } catch (e: any) { - core.warning(`Failed to comment: ${e}, skipping. + try { + const [response, patch_ids] = await bot.chat( + prompts.render_review_patch(ins), + next_review_ids + ) + if (!response) { + core.info('review: nothing obtained from openai') + continue + } + next_review_ids = patch_ids + if (!options.review_comment_lgtm && response.includes('LGTM')) { + continue + } + await commenter.review_comment( + context.payload.pull_request.number, + commits[commits.length - 1].sha, + filename, + line, + `${response}` + ) + } catch (e: any) { + core.warning(`Failed to comment: ${e}, skipping. backtrace: ${e.stack} filename: ${filename} line: ${line} patch: ${patch}`) - } - } - }) - ) + } + } + } + + // Use Promise.all to run file review processes in parallel + // rewrite this to take max_files_to_review limit into account + // const reviewPromises = files_to_review.map( + // async ([filename, file_content, file_diff, patches]) => + // openai_concurrency_limit(async () => + // review(filename, file_content, file_diff, patches) + // ) + // ) + const reviewPromises = [] + const skipped_files_to_review = [] + for (const [ + filename, + file_content, + file_diff, + patches + ] of files_to_review) { + if (reviewPromises.length < options.max_files_to_review) { + reviewPromises.push( + openai_concurrency_limit(async () => + review(filename, file_content, file_diff, patches) + ) + ) + } else { + skipped_files_to_review.push(filename) + } + } await Promise.all(reviewPromises) + + // comment about skipped files for review and summarize + if ( + skipped_files_to_review.length > 0 || + skipped_files_to_summarize.length > 0 + ) { + const tag = '' + // make bullet points for skipped files + const comment = ` +${tag} + + ${ + skipped_files_to_summarize.length > 0 + ? ` +### Files not summarized +- ${skipped_files_to_summarize.join('\n - ')}` + : '' + } + ${ + skipped_files_to_review.length > 0 + ? ` +### Files not reviewed +- ${skipped_files_to_review.join('\n - ')}` + : '' + } + ` + await commenter.comment(comment, tag, 'replace') + } } } From a3795f386a7c1362adca0fae4eb9879d5a983746 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 24 Mar 2023 13:07:42 -0700 Subject: [PATCH 2/5] separate config for max files to summarize and review --- src/review.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/review.ts b/src/review.ts index 9987e7aa..1ffd4593 100644 --- a/src/review.ts +++ b/src/review.ts @@ -235,7 +235,7 @@ ${ --- -### Tips +### Chatting with 🤖 OpenAI Bot (\`@openai\`) - Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file. - Invite the bot into a review comment chain by tagging \`@openai\` in a reply. From 326b36ef37b538766103a1a2919a25af4820c773 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 24 Mar 2023 13:13:44 -0700 Subject: [PATCH 3/5] separate config for max files to summarize and review --- dist/index.js | 103 ++++++++++++++++++++++++++++++++++---------------- src/review.ts | 2 +- tsconfig.json | 16 +++----- 3 files changed, 77 insertions(+), 44 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6b6174fd..843a2a7b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3897,7 +3897,7 @@ __nccwpck_require__.r(__webpack_exports__); async function run() { - const options = new _options_js__WEBPACK_IMPORTED_MODULE_2__/* .Options */ .Ei(_actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('debug'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('max_files'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('review_comment_lgtm'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput('path_filters'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('system_message'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_model'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_model_temperature'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_retries'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_timeout_ms'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_concurrency_limit')); + const options = new _options_js__WEBPACK_IMPORTED_MODULE_2__/* .Options */ .Ei(_actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('debug'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('max_files_to_summarize'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('max_files_to_review'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('review_comment_lgtm'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput('path_filters'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('system_message'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_model'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_model_temperature'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_retries'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_timeout_ms'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('openai_concurrency_limit')); const prompts = new _options_js__WEBPACK_IMPORTED_MODULE_2__/* .Prompts */ .jc(_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('review_beginning'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('review_file'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('review_file_diff'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('review_patch_begin'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('review_patch'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('summarize_beginning'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('summarize_file_diff'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('summarize'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('summarize_release_notes'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('comment_beginning'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('comment_file'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('comment_file_diff'), _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('comment')); // initialize openai bot let bot = null; @@ -5583,7 +5583,8 @@ class Inputs { } class Options { debug; - max_files; + max_files_to_summarize; + max_files_to_review; review_comment_lgtm; path_filters; system_message; @@ -5593,9 +5594,10 @@ class Options { openai_timeout_ms; openai_concurrency_limit; max_tokens_for_extra_content; - constructor(debug, max_files = '60', review_comment_lgtm = false, path_filters = null, system_message = '', openai_model = 'gpt-3.5-turbo', openai_model_temperature = '0.0', openai_retries = '3', openai_timeout_ms = '60000', openai_concurrency_limit = '4') { + constructor(debug, max_files_to_summarize = '60', max_files_to_review = '180', review_comment_lgtm = false, path_filters = null, system_message = '', openai_model = 'gpt-3.5-turbo', openai_model_temperature = '0.0', openai_retries = '3', openai_timeout_ms = '60000', openai_concurrency_limit = '4') { this.debug = debug; - this.max_files = parseInt(max_files); + this.max_files_to_summarize = parseInt(max_files_to_summarize); + this.max_files_to_review = parseInt(max_files_to_review); this.review_comment_lgtm = review_comment_lgtm; this.path_filters = new PathFilter(path_filters); this.system_message = system_message; @@ -6033,25 +6035,19 @@ const codeReview = async (bot, options, prompts) => { return; } // skip files if they are filtered out - const filtered_files = []; - const skipped_files = []; + const filter_selected_files = []; + const filter_skipped_files = []; for (const file of files) { if (!options.check_path(file.filename)) { core.info(`skip for excluded path: ${file.filename}`); - skipped_files.push(file); + filter_skipped_files.push(file); } else { - filtered_files.push(file); + filter_selected_files.push(file); } } - // check if we are exceeding max_files and if max_files is <= 0 (no limit) - if (filtered_files.length > options.max_files && options.max_files > 0) { - core.warning("Skipped: too many files to review, can't handle it"); - await commenter.comment(`Skipped: too many files to review, can't handle it`, lib_commenter/* SUMMARIZE_TAG */.Rp, 'replace'); - return; - } // find patches to review - const filtered_files_to_review = await Promise.all(filtered_files.map(async (file) => { + const filtered_files_to_review = await Promise.all(filter_selected_files.map(async (file) => { // retrieve file contents let file_content = ''; if (!context.payload.pull_request) { @@ -6127,7 +6123,16 @@ const codeReview = async (bot, options, prompts) => { } return null; }; - const summaryPromises = files_to_review.map(async ([filename, file_content, file_diff]) => openai_concurrency_limit(async () => generateSummary(filename, file_content, file_diff))); + const summaryPromises = []; + const skipped_files_to_summarize = []; + for (const [filename, file_content, file_diff] of files_to_review) { + if (summaryPromises.length < options.max_files_to_summarize) { + summaryPromises.push(openai_concurrency_limit(async () => generateSummary(filename, file_content, file_diff))); + } + else { + skipped_files_to_summarize.push(filename); + } + } const summaries = (await Promise.all(summaryPromises)).filter(summary => summary !== null); if (summaries.length > 0) { inputs.summary = ''; @@ -6146,24 +6151,20 @@ ${filename}: ${summary} } else { inputs.summary = summarize_final_response; - // make a bullet point list of skipped files - let skipped_files_str = ''; - if (skipped_files.length > 0) { - skipped_files_str = `--- - -These files were skipped from the review: -`; - for (const file of skipped_files) { - skipped_files_str += `- ${file.filename}\n`; - } - } const summarize_comment = `${summarize_final_response} -${skipped_files_str} +${filter_skipped_files.length > 0 + ? ` +--- + +### Skipped files +- ${filter_skipped_files.map(file => file.filename).join('\n- ')} +` + : ''} --- -Tips: +### Chatting with 🤖 OpenAI Bot (\`@openai\`) - Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file. - Invite the bot into a review comment chain by tagging \`@openai\` in a reply. @@ -6184,8 +6185,7 @@ Tips: } // Review Stage const [, review_begin_ids] = await bot.chat(prompts.render_review_beginning(inputs), {}); - // Use Promise.all to run file review processes in parallel - const reviewPromises = files_to_review.map(async ([filename, file_content, file_diff, patches]) => openai_concurrency_limit(async () => { + const review = async (filename, file_content, file_diff, patches) => { // reset chat session for each file while reviewing let next_review_ids = review_begin_ids; // make a copy of inputs @@ -6286,8 +6286,47 @@ Tips: patch: ${patch}`); } } - })); + }; + // Use Promise.all to run file review processes in parallel + // rewrite this to take max_files_to_review limit into account + // const reviewPromises = files_to_review.map( + // async ([filename, file_content, file_diff, patches]) => + // openai_concurrency_limit(async () => + // review(filename, file_content, file_diff, patches) + // ) + // ) + const reviewPromises = []; + const skipped_files_to_review = []; + for (const [filename, file_content, file_diff, patches] of files_to_review) { + if (reviewPromises.length < options.max_files_to_review) { + reviewPromises.push(openai_concurrency_limit(async () => review(filename, file_content, file_diff, patches))); + } + else { + skipped_files_to_review.push(filename); + } + } await Promise.all(reviewPromises); + // comment about skipped files for review and summarize + if (skipped_files_to_review.length > 0 || + skipped_files_to_summarize.length > 0) { + const tag = ''; + // make bullet points for skipped files + const comment = ` +${tag} + + ${skipped_files_to_summarize.length > 0 + ? ` +### Files not summarized +- ${skipped_files_to_summarize.join('\n - ')}` + : ''} + ${skipped_files_to_review.length > 0 + ? ` +### Files not reviewed +- ${skipped_files_to_review.join('\n - ')}` + : ''} + `; + await commenter.comment(comment, tag, 'replace'); + } } }; // Write a function that takes diff for a single file as a string diff --git a/src/review.ts b/src/review.ts index 1ffd4593..a53be999 100644 --- a/src/review.ts +++ b/src/review.ts @@ -198,7 +198,7 @@ export const codeReview = async ( const summaries = (await Promise.all(summaryPromises)).filter( summary => summary !== null - ) + ) as [string, string][] if (summaries.length > 0) { inputs.summary = '' diff --git a/tsconfig.json b/tsconfig.json index 1ee66166..d541ca2a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,5 @@ { "compilerOptions": { - "target": "es2020", - "lib": ["esnext"], "incremental": false, "sourceMap": false, "allowJs": true, @@ -9,17 +7,13 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "module": "esnext", + "target": "ESNext", + "module": "ESNext", "outDir": "./lib", "rootDir": "./src", + "strict": true, "noImplicitAny": true, - "esModuleInterop": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "baseUrl": ".", - "noEmit": true + "esModuleInterop": true }, - "exclude": ["dist", "lib", "node_modules", "**/*.test.ts"], - "include": ["**/*.ts"] + "exclude": ["dist", "lib", "node_modules", "**/*.test.ts"] } From d4bbd28875b48ee202eb6a1ef9fd4ee7ced84c10 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 24 Mar 2023 13:17:51 -0700 Subject: [PATCH 4/5] separate config for max files to summarize and review --- dist/index.js | 6 +++--- src/review.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 843a2a7b..1551071f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6157,7 +6157,7 @@ ${filter_skipped_files.length > 0 ? ` --- -### Skipped files +### Skipped files (${filter_skipped_files.length}) - ${filter_skipped_files.map(file => file.filename).join('\n- ')} ` : ''} @@ -6316,12 +6316,12 @@ ${tag} ${skipped_files_to_summarize.length > 0 ? ` -### Files not summarized +### Files not summarized (${skipped_files_to_summarize.length}) - ${skipped_files_to_summarize.join('\n - ')}` : ''} ${skipped_files_to_review.length > 0 ? ` -### Files not reviewed +### Files not reviewed (${skipped_files_to_review.length}) - ${skipped_files_to_review.join('\n - ')}` : ''} `; diff --git a/src/review.ts b/src/review.ts index a53be999..c0aaaf13 100644 --- a/src/review.ts +++ b/src/review.ts @@ -227,7 +227,7 @@ ${ ? ` --- -### Skipped files +### Skipped files (${filter_skipped_files.length}) - ${filter_skipped_files.map(file => file.filename).join('\n- ')} ` : '' @@ -444,14 +444,14 @@ ${tag} ${ skipped_files_to_summarize.length > 0 ? ` -### Files not summarized +### Files not summarized (${skipped_files_to_summarize.length}) - ${skipped_files_to_summarize.join('\n - ')}` : '' } ${ skipped_files_to_review.length > 0 ? ` -### Files not reviewed +### Files not reviewed (${skipped_files_to_review.length}) - ${skipped_files_to_review.join('\n - ')}` : '' } From 7f94d0a80320474a4fc0b8590db56c407a81d318 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 24 Mar 2023 13:18:29 -0700 Subject: [PATCH 5/5] separate config for max files to summarize and review --- dist/index.js | 2 +- src/review.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1551071f..7fe26d70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6157,7 +6157,7 @@ ${filter_skipped_files.length > 0 ? ` --- -### Skipped files (${filter_skipped_files.length}) +### Skipped files due to filter (${filter_skipped_files.length}) - ${filter_skipped_files.map(file => file.filename).join('\n- ')} ` : ''} diff --git a/src/review.ts b/src/review.ts index c0aaaf13..92ec4ad8 100644 --- a/src/review.ts +++ b/src/review.ts @@ -227,7 +227,7 @@ ${ ? ` --- -### Skipped files (${filter_skipped_files.length}) +### Skipped files due to filter (${filter_skipped_files.length}) - ${filter_skipped_files.map(file => file.filename).join('\n- ')} ` : ''