fix: detect unchecked tasks in nested PR task lists#807
Conversation
The pr-tasks-list handler only inspected top-level list items, missing unchecked tasks nested under checked parents. Recursively walk the marked token tree so nested task items are included in the check. Closes #48 Signed-off-by: Tomer Figenblat <tomer@figenblat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughThe handler now recursively extracts task list items (including nested subtasks) from Markdown tokens and uses a helper to obtain visible task text when building task lists. Tests exercising nested unchecked and all-checked scenarios were added. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
==========================================
- Coverage 98.85% 98.77% -0.08%
==========================================
Files 7 7
Lines 958 981 +23
==========================================
+ Hits 947 969 +22
- Misses 11 12 +1 🚀 New features to boost your workflow:
|
Summary
pr-tasks-listhandler only inspected top-level list items frommarked, so unchecked tasks nested under checked parents were never detected — causing false success outcomes.extractTaskItemsto walk the full token tree includingitem.tokensfor nested lists.getTaskTexthelper to extract only the direct text of a task item, excluding nested list content thatmarkedincludes initem.text.Closes #48
Test plan
Summary by CodeRabbit