Port Packer, Gradle, jq, Liquibase and Ansible scrapers onto the shared wrapped-description helper - #4657
Conversation
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. |
…iption helper Collapse the private AccumulateMultiLineDescription variants in the Packer, Gradle, jq, Liquibase and Ansible scrapers onto CliScraperBase.AccumulateWrappedDescription, so their absolute indent thresholds and dash-led stop rules 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. Each scraper now only supplies its own option-row predicate. jq strips its displayed operands after the wrapped lines are joined; Ansible normalises line endings once at the split. Teach the base to infer the description column from the first wrapped line when a row carries no inline description, so two-line picocli and argparse rows get the same protection. Closes #4653 Claude-Session: https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC
eee8705 to
a32ef50
Compare
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches📝 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 |
Code reviewReviewed the diff and the current state of Summary: This ports Packer, Gradle, jq, Liquibase, and Ansible onto the shared Verified in detail:
No actionable issues found — this is a clean, well-scoped refactor consistent with the repo's generated-options conventions. |
…ion helper (#4658) * refactor(generator): port nine more scrapers onto the shared wrapped-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 * fix(generator): accept the first wrapped line before a description column 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
Summary
First child of #4646. Ports the five scrapers whose wrapped-description logic was closest to the shared shape onto
CliScraperBase.AccumulateWrappedDescription(from #4645):-only=foo,bar ...fragment now stays in the description instead of becoming a phantom option.< 4indent threshold; a wrapped--continue ...fragment stays prose.< 20threshold; the displayed operands are stripped after the wrapped lines are joined, so the operand prefix is removed once.< 20threshold; the row predicate covers both the option and-D=PARAMshapes.TrimEnd('\r')); sibling rows at the declaration's indentation now stop the description as they should.Each scraper only supplies its own option-row predicate; none defines its own accumulation loop or indentation counter any more.
One base improvement fell out of the Liquibase port: a row whose prose only begins on the next line (picocli, argparse, git) 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, which benefits every scraper.Behavioural notes
Per the parent issue's scope note this changes generated output for these tools wherever wrapped descriptions previously mis-parsed; regenerate the five packages via the workflow after merge. Remaining scrapers are tracked in #4654 and #4655.
Test plan
PackerCliScraperTests), Gradle, jq, Liquibase (inline and two-line rows), Ansible — each pins a wrapped--flag-led line as prose.ModularPipelines.OptionsGenerator.Tests: 1304 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 #4653
https://claude.ai/code/session_01PkLNTUfwGXjqXZrYrHaDGC