fix(validate): require marker punctuation after a leading TBD/TODO - #1912
Tyagiquamar wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe purpose validator now avoids treating “Todo” followed by prose as a placeholder marker. It still detects standalone ChangesPurpose validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change addresses the stated false positives and no supported regression remains blocking merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
Hi, just following up on this when you get a chance. The branch is up to date and checks are green. If it looks good from your side, it should be ready to merge. Happy to make any changes if needed. Thanks! |
Closes #1897.
Root cause: LEADING_MARKER in src/core/validation/purpose-placeholder.ts was case-insensitive with a negative lookahead that a plain space satisfies, so the Spanish/Portuguese sentence opener Todo followed by prose matched the TODO placeholder marker and validate --strict failed an authored Purpose.
Fix: keep the existing word-boundary lookahead and add a second lookahead requiring end of Purpose, a line break, or marker punctuation after TBD/TODO. This is the issue's suggested option 2, refined so every existing pinned behaviour still holds: lowercase tbd - / todo - , TODO:, TODO(owner):, TBD. and bare TBD/TODO are still reported, while Todo el... / Todo o... prose is not.
Tests: added Spanish and Portuguese regression cases plus a marker-alone-on-its-line case to test/core/purpose-placeholder.test.ts. New test failed before the fix ({line: 4} instead of null) and passes after. Added .changeset/purpose-marker-punctuation.md (patch).
Validation in Docker (node:22-bookworm, pnpm 10.34.5): pnpm build exit 0; vitest test/core 117 files / 4441 passed / 1 skipped; tsc --noEmit exit 0; eslint exit 0. Full pnpm test was not run to completion: cli-e2e/prompts suites stall in this sandbox; all unit suites under test/core pass.
Assisted by Muse Spark; the change was verified with the Docker runs above.
Summary by CodeRabbit
TODOandTBDare now recognized only when followed by valid boundaries or marker punctuation.