fix: get storage type better with tm-core#1347
Conversation
|
WalkthroughMultiple CLI commands are updated to retrieve the storage type from a dedicated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/cli/src/commands/show.command.ts (1)
159-165: Remove unnecessary type cast at line 164 for consistency.Both
getSingleTask()andgetMultipleTasks()return results typed asShowTaskResultandShowMultipleTasksResult, which requirestorageType: Exclude<StorageType, 'auto'>. SincegetStorageType()already returns'file' | 'api'(as documented in tm-core), the cast at line 164 is redundant. Line 198 correctly omits it. Remove the cast at line 164 to align both methods:storageType: storageType // instead of: storageType as Exclude<StorageType, 'auto'>
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/cli/src/commands/next.command.ts(1 hunks)apps/cli/src/commands/set-status.command.ts(1 hunks)apps/cli/src/commands/show.command.ts(2 hunks)apps/cli/src/commands/start.command.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tag resolution functions for all task data access, provide backward compatibility with legacy format, and default to 'master' tag when no tag is specified.
Applied to files:
apps/cli/src/commands/next.command.ts
🔇 Additional comments (3)
apps/cli/src/commands/set-status.command.ts (1)
167-167: LGTM: Clean refactoring to centralized storage type retrieval.The change correctly delegates storage type resolution to the core tasks API, ensuring consistency across commands.
apps/cli/src/commands/show.command.ts (1)
192-199: Approve with consistency note.The storage type retrieval correctly uses the centralized core method. However, note the inconsistency with line 164 where a type cast was used but is absent here.
apps/cli/src/commands/next.command.ts (1)
130-139: LGTM: Clean implementation of centralized storage type retrieval.The change correctly retrieves the resolved storage type from the core tasks API and properly types it as
Exclude<StorageType, 'auto'>in the interface. No type casting needed, indicating the API contract is well-aligned.
What type of PR is this?
Description
Related Issues
How to Test This
# Example commands or stepsExpected result:
Contributor Checklist
npm run changesetnpm testnpm run format-check(ornpm run formatto fix)Changelog Entry
For Maintainers
Summary by CodeRabbit