fix(enrichment): enumerate generic-typed and generic-default params in doc-comment drift - #1875
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-30 19:10:19 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
4a61f5c to
0a98bf0
Compare
…n doc-comment drift Follow-up to JSONbored#1794. `parseFunctionParams` split parameter lists on every top-level comma without tracking generic `<…>`, so a comma inside a generic type or default value (e.g. `cache = new Map<string, number>()` or `a: Map<K, V>`) split mid-generic, produced an unparseable fragment, and made the whole function skip — silently MISSING a documented-but-removed parameter (the false negative noted on the JSONbored#1794 review). Make `splitParams` generic-aware: a `<` with a balanced matching `>` is treated as one opaque generic argument list (its commas don't split), while a `<`/`>` with no match stays a comparison operator. This fixes the false negative, keeps comparison/arrow defaults enumerable, and removes the prior need to drop type-argument fragments. Adds unit + end-to-end regressions.
0a98bf0 to
f8788e8
Compare
Summary
Follow-up to #1794, addressing the false negative called out on its review:
Root cause (signature side, not the doc side).
parseFunctionParamssplit a parameter list on every top-level comma without tracking generic<…>. So a comma inside a generic type or default value split the list mid-generic:That produced an unparseable fragment,
parseFunctionParamsreturnednull, and the whole function was skipped — so a documented-but-removed sibling parameter was silently missed (no drift reported).Fix
Make
splitParamsgeneric-aware: on<, look ahead for a balanced matching>. If found, the<…>is treated as one opaque generic argument list (its commas don't split —Map<K, V>stays one segment). If there's no match, the</>is a comparison/arrow operator and is ignored. This:max > 0 ? …) and callback/arrow defaults enumerable, andValidation
From
review-enrichment/(Node 24):New coverage:
parseFunctionParamsonMap<K, V>,Map<K, readonly V[]>,new Map<string, number>()defaults, and nested generics; plus an end-to-endscanDocCommentDriftregression where a removed-and-documented param sits beside a sibling with anew Map<string, number>()default and is now correctly reported.