Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

collapse skipped files lists #95

Merged
merged 4 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 44 additions & 31 deletions src/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,32 +225,42 @@ ${filename}: ${summary}

const summarize_comment = `${summarize_final_response}

${
filter_ignored_files.length > 0
? `
---

### Files ignored due to filter (${filter_ignored_files.length})
- ${filter_ignored_files.map(file => file.filename).join('\n- ')}
### Chat 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.

---

${filter_ignored_files.length > 0
? `
<details>
<summary>Files ignored due to filter (${filter_ignored_files.length})</summary>

### Ignored files

* ${filter_ignored_files.map(file => file.filename).join('\n* ')}

</details>
`
: ''
}
: ''
}

${
skipped_files_to_summarize.length > 0
? `
### Files not summarized due to max files limit (${
skipped_files_to_summarize.length
})
- ${skipped_files_to_summarize.join('\n - ')}`
: ''
}
${skipped_files_to_summarize.length > 0
? `
<details>
<summary>Files not summarized due to max files limit (${skipped_files_to_summarize.length
})</summary>

---
### Not summarized

### Chat 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.
* ${skipped_files_to_summarize.join('\n* ')}

</details>
`
: ''
}
`

next_summarize_ids = summarize_final_response_ids
Expand Down Expand Up @@ -445,22 +455,25 @@ ${

// comment about skipped files for review and summarize
if (skipped_files_to_review.length > 0) {
const tag = '<!-- openai-skipped-files -->'
// make bullet points for skipped files
const comment = `
${tag}
${skipped_files_to_review.length > 0
? `<details>
<summary>Files not reviewed due to max files limit (${skipped_files_to_review.length
})</summary>

${
skipped_files_to_review.length > 0
? `
### Files not reviewed due to max files limit (${
skipped_files_to_review.length
})
- ${skipped_files_to_review.join('\n - ')}`
### Not reviewed

* ${skipped_files_to_review.join('\n* ')}

</details>
`
: ''
}
}
`
await commenter.comment(comment, tag, 'replace')
if (comment.length > 0) {
await commenter.comment(comment, SUMMARIZE_TAG, 'append')
}
}
}
}
Expand Down