Port the remaining nine CLI scrapers onto the shared wrapped-description helper - #4658
Conversation
…description helper Collapse the private AccumulateMultiLineDescription variants in the Az, DotNet, Go, Maven, pip, pnpm, Terraform, WinGet and Yarn scrapers (and Go's private tab-aware indentation counter) onto CliScraperBase.AccumulateWrappedDescription. Their dash-led stops, absolute indent thresholds and ad hoc section-header heuristics give way to the column-aware rule from #4645: a wrapped line that looks like an option row stays prose when it starts at or after the description column, and prose continues while it is deeper than the declaration. Each scraper now only supplies its own option-row predicate; go joins the prose beneath its flag lines because its inline text is derived rather than captured. Teach the base to infer the description column from the first wrapped line when a row carries no inline description (the same hunk ships in #4657), and pin that mechanism with direct tests. Closes #4654 Claude-Session: https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (19)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe CLI scrapers now share wrapped-description parsing. The parser tracks the description column and uses scraper-specific option-row predicates. Tests cover wrapped lines that resemble options across nine CLI formats. ChangesWrapped description parsing
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The wrapped-description migration preserves option-like prose and next-option boundaries across the updated CLI scrapers. No merge-blocking risk remains. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
ReviewSolid refactor: deleting nine near-duplicate Finding
var indentation = GetIndentation(line);
var wrappedAtDescriptionColumn = indentation >= descriptionColumn;
return (!looksLikeOptionRow || wrappedAtDescriptionColumn)
&& indentation > declarationIndentation;When a row has no inline description, This is largely theoretical for the other eight scrapers here, since their Suggested fix: treat "column not yet known" as "accept," not "reject," since the whole point of the fallback is that there's nothing to compare against yet: var wrappedAtDescriptionColumn = descriptionColumn is null || indentation >= descriptionColumn;This only changes behavior for the untested null-column + option-row-looking-first-line combination — both new Given the narrowness of the trigger (Go, no inline description, first wrapped line only), consider adding one direct |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…lumn is known With no inline description the column is inferred from the first wrapped line, but IsContinuationLine compared against the still-null column, which is always false in C#. A first wrapped line that also matched the scraper's option pattern (any indented "-x ..." for Go) was therefore rejected before the inference could run, and the main loop would mint a bogus option from it. Treat an unknown column as "accept any line deeper than the declaration"; later lines are still measured against the inferred column. Refs #4654 Claude-Session: https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
|
Addressed the finding in 932832d: |
ReviewRe-reviewed at head var wrappedAtDescriptionColumn = descriptionColumn is null || indentation >= descriptionColumn;This is exactly the right fix — "column not yet known" now means "accept," which is what lets the first wrapped line actually establish the column instead of being rejected before the The rest of the diff is a clean, mechanical continuation of the #4645 pattern: each of the nine scrapers (Az, DotNet, Go, Maven, pip, pnpm, Terraform, WinGet, Yarn) drops its own hand-rolled One non-blocking suggestionGo is the scraper most exposed to the bug that was just fixed, since Nice work addressing the review; the fix and tests both landed in the right place. |
ReviewRe-reviewed at head I independently traced the same risk area the prior review round flagged as blocking: The one gap noted in the prior round — Go being the scraper most exposed to this, since No other issues found. The other eight scrapers all pass their real inline-description |
With #4658 an unknown description column accepts any deeper line, so the repeatable lookahead absorbed every following option row after a declaration without inline prose (argparse-style help) until the next blank line. Take the column from the first accepted wrapped line, as AccumulateWrappedDescription already does, and make the terminal-hint regression realistic: prose deep, nested option row shallow. Refs #4655 Claude-Session: https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
Summary
Second child of #4646. Ports the remaining nine scrapers onto
CliScraperBase.AccumulateWrappedDescription(from #4645): Az, DotNet, Go, Maven, pip, pnpm, Terraform, WinGet, Yarn. Their private accumulators (dash-led stops, absolute indent thresholds of 8–30 spaces, and per-tool section-header heuristics) and Go's privateGetIndentationWidthare deleted; each scraper now supplies only its own option-row predicate. Every ported scraper has a fixture that pins a wrapped--flag-led line as prose (Go's existingPreserves_Hyphen_Led_Description_Continuationsalready covers it).Base: a row whose prose only begins on the next line (go, picocli, argparse) had no description column, so the column-aware rule could not protect its later wrapped lines.
AccumulateWrappedDescriptionnow infers the column from the first wrapped line. The same four-line hunk is in #4657 (deliberately identical so either PR can land first; git merges it as a no-op), and it is pinned here by two directContinuationLineTestscases.Behavioural notes
Argument '--x' is in preview…); the old< 20threshold dropped those lines, the depth rule now joins them into the description. Pinned inAzCliScraperTests.HelpDeclaresRepeatableOptionis tracked in Use the shared continuation rule in CliScraperBase.HelpDeclaresRepeatableOption #4655.Test plan
PipCliScraperTests), pnpm (newPnpmCliScraperTests), Terraform, WinGet, Yarn; two direct base tests for the inferred column.ModularPipelines.OptionsGenerator.Tests: 1328 passed, 0 failed (guarded local run).dotnet format whitespace --verify-no-changesclean for the touched files (the only remaining hit,IHelpTextCache.cs, pre-exists onmain).Closes #4654
https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
Summary by CodeRabbit
Bug Fixes
Tests