Release/1.2.1#5
Conversation
📝 WalkthroughWalkthroughThis PR increments the package version to 1.2.1 and introduces a refactored CLI help system with condensed root help output, adds a new repeatable Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/commands/issues.ts (1)
135-147: Small optimization: dedupe requested labels and useSetlookups.This keeps behavior the same while reducing repeated checks and improving membership lookup cost.
Suggested refactor
if (label.length > 0) { - const labelIds: string[] = []; - for (const l of label) { + const requestedLabels = [...new Set(label)]; + const labelIds: string[] = []; + for (const l of requestedLabels) { const resolved = yield* resolveLabel(id, l); labelIds.push(resolved.id); } filtered = filtered.filter((i) => { if (!Array.isArray(i.labels)) return false; - const issueLabelIds = i.labels.map((l) => + const issueLabelIds = new Set(i.labels.map((l) => typeof l === "string" ? l : l.id, - ); - return labelIds.every((lid) => issueLabelIds.includes(lid)); + )); + return labelIds.every((lid) => issueLabelIds.has(lid)); }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/issues.ts` around lines 135 - 147, The label filtering currently builds labelIds with potential duplicates and uses array.includes repeatedly; change the logic in the block using resolveLabel, labelIds and the filtered.filter callback to dedupe requested labels (e.g. collect resolved.id into a Set) and perform membership checks via Set.has for each issue's label ids (derive issueLabelIds as before but check every requested id via the Set) to reduce repeated checks and improve lookup cost while keeping behavior the same..husky/pre-commit (1)
12-16: Keep failures visible when checks are non-fatal.
|| trueis fine for non-blocking flow, but explicit warning output makes failures harder to miss during commit.Suggested tweak
-"$BUN" scripts/check-file-size.ts || true +"$BUN" scripts/check-file-size.ts || echo "warning: file-size check failed (non-fatal)" >&2 @@ -"$BUN" scripts/check-coverage.ts || true +"$BUN" scripts/check-coverage.ts || echo "warning: coverage check failed (non-fatal)" >&2🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.husky/pre-commit around lines 12 - 16, The pre-commit hooks run scripts scripts/check-file-size.ts and scripts/check-coverage.ts with "|| true", which hides failures; change the invocation so you capture the exit status of each "$BUN" command and, if non-zero, print an explicit warning message naming the script (e.g. "Warning: scripts/check-file-size.ts failed (exit <code>)") while still allowing the hook to continue; update both invocations that currently use "|| true" to perform this check and warning logic so failures remain visible in the commit output.tests/issue-commands.test.ts (1)
537-557: Consider extracting a shared log-capture helper in this test file.The new cases repeat the same
console.loginterception pattern; a helper would reduce duplication and future edits.♻️ Suggested refactor
+async function captureLogs(fn: () => Promise<void>): Promise<string> { + const logs: string[] = []; + const orig = console.log; + console.log = (...args: unknown[]) => logs.push(args.join(" ")); + try { + await fn(); + } finally { + console.log = orig; + } + return logs.join("\n"); +}-const logs: string[] = []; -const orig = console.log; -console.log = (...args: unknown[]) => logs.push(args.join(" ")); - -try { - await Effect.runPromise(/* ... */); -} finally { - console.log = orig; -} -const output = logs.join("\n"); +const output = await captureLogs(() => + Effect.runPromise(/* ... */), +);Also applies to: 613-633, 662-682
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/issue-commands.test.ts` around lines 537 - 557, The test repeats console.log interception around calls to issuesListHandler; extract a small helper (e.g., captureConsoleLogs or withCapturedLogs) that accepts an async callback, replaces console.log with a collector, runs the callback, restores the original console.log, and returns the collected logs (and/or callback result); then replace the inline pattern around issuesListHandler calls with this helper to remove duplication and reuse it for the other occurrences (the blocks that currently create logs: string[], save orig, override console.log, try/finally restore).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.husky/pre-commit:
- Around line 12-16: The pre-commit hooks run scripts scripts/check-file-size.ts
and scripts/check-coverage.ts with "|| true", which hides failures; change the
invocation so you capture the exit status of each "$BUN" command and, if
non-zero, print an explicit warning message naming the script (e.g. "Warning:
scripts/check-file-size.ts failed (exit <code>)") while still allowing the hook
to continue; update both invocations that currently use "|| true" to perform
this check and warning logic so failures remain visible in the commit output.
In `@src/commands/issues.ts`:
- Around line 135-147: The label filtering currently builds labelIds with
potential duplicates and uses array.includes repeatedly; change the logic in the
block using resolveLabel, labelIds and the filtered.filter callback to dedupe
requested labels (e.g. collect resolved.id into a Set) and perform membership
checks via Set.has for each issue's label ids (derive issueLabelIds as before
but check every requested id via the Set) to reduce repeated checks and improve
lookup cost while keeping behavior the same.
In `@tests/issue-commands.test.ts`:
- Around line 537-557: The test repeats console.log interception around calls to
issuesListHandler; extract a small helper (e.g., captureConsoleLogs or
withCapturedLogs) that accepts an async callback, replaces console.log with a
collector, runs the callback, restores the original console.log, and returns the
collected logs (and/or callback result); then replace the inline pattern around
issuesListHandler calls with this helper to remove duplication and reuse it for
the other occurrences (the blocks that currently create logs: string[], save
orig, override console.log, try/finally restore).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0e9a2fa5-2aa5-4f90-b5ed-9e687a0151aa
📒 Files selected for processing (15)
.gitignore.husky/pre-commitAGENTS.mdCHANGELOG.mdREADME.mdSKILL.mdpackage.jsonsrc/app.tssrc/bin.tssrc/commands/issues.tssrc/project-agents.tstests/app.test.tstests/issue-commands.test.tstests/json-output.test.tstests/xml-output.test.ts
💤 Files with no reviewable changes (2)
- AGENTS.md
- src/project-agents.ts
Summary
Describe the change and the user-facing outcome.
Related Issue
Link the relevant GitHub issue, discussion, or explain why no public tracking item was needed.
Changes
Validation
bun run typecheckbun testcoverage for the touched areabun run check:allif shared command behavior, schemas, or output changedDocs
README.mdupdated if CLI usage changedSKILL.mdupdated if AI-agent usage changedCHANGELOG.mdupdated if there is a notable user-facing changeRisks Or Follow-Ups
Summary by CodeRabbit
New Features
--labelfilter forplane issues listcommand—repeatable with AND-based filtering logicplane --help, detailed syntax withplane <command> --helpBug Fixes
Documentation
Chores
.gitignorepatterns