Skip to content

CLI help keeps its placeholders: ferro migrate --help prints <name>, <migration>:<step> and the rest #702

Closed

Description

@0x054

Parent

#698

What to build

ferro migrate rerecord --help prints "The step whose edit to accept: :, as 0007:01." because help text is rendered as Markdown and <migration>:<step> is swallowed as an HTML tag. Seven help strings lose their placeholders (new, squash, rerecord and others).

Help renders as plain text on both the root app and the migrate app, so every placeholder prints as written. A test pins it.

Acceptance criteria

  • ferro migrate rerecord --help prints <migration>:<step>.
  • ferro migrate new --help and ferro migrate squash --help print NN_<name>.up.sql-style placeholders intact.
  • Every <...> placeholder written in any command's help source appears verbatim in that command's --help output (pinned by the new test).
  • No other help text changes rendering (headings, option tables, defaults render as before).

Files owned

  • Create: tests/test_cli_help.py
  • Modify: src/ferro/cli/__init__.py, src/ferro/cli/migrate.py

Interfaces

Test scenarios

  • Happy path: ferro migrate rerecord --help output contains <migration>:<step>.
  • Edge case: a help string with two placeholders on one line keeps both.
  • Error path: switching the help format back to Markdown makes the test fail for rerecord, new and squash.

Verify

uv run --no-sync pytest tests/test_cli_help.py -q --no-cov -p no:cacheprovider
uv run --no-sync ferro migrate rerecord --help | grep -F '<migration>:<step>'

Blocked by

None (can start immediately)

Audit findings

Rows from the docs audit this ticket covers (file, line, rule, fix)

src/ferro/cli/ — main, render_refusal, Global, and ferro migrate <verb> --help

  • Kind: reference (help text)
  • Verdict: the verb summaries are the most consistent prose in scope: all infinitive, one line, and exit codes stated (check 0/3, status 0/3/4, drift 0/4). One rendering defect wipes out the placeholder in seven help strings. C (B once the H is fixed)
Sev Line Rule Finding Suggested fix
H migrate.py 170, 179, 198, 210, 222, 270, 280, 289, 308, 690 8, 22 cyclopts renders help as Markdown, which drops <name>, <model>, <table>.<column>, <migration>:<step> as HTML tags. The real output reads "writes NNNN_/", "SQL step NN_.up.sql", "data step NN_backfill_.py", "this column (., repeatable)", and for rerecord: "The step whose edit to accept: :, as 0007:01." Set help_format="plaintext" (or "rich") on both Apps, or wrap placeholders in backticks. Add a test that asserts <name> survives in --help.
M migrate.py 210–213 15 --replace help ends "…carrying its data steps and hand-written SQL steps across: two branches that each generated the same number." The use case comes after the colon as a fragment. Put the condition first: "When two branches generated the same number, regenerate this migration…".
L status --help 22 --steps --no-steps and --json --no-json show negative flags, while every other boolean sets negative="" (--verbose, --data-only, --all). negative="" on both.
L new/squash --help — An extra blank line after the summary, and a blank line after --no-backfill STR... and rerecord's TARGET. Both are side effects of the same Markdown parsing. Fixed by the plaintext format.
L cli/init.py 1–20, 42, 53 22 Module/Global/render_refusal docstrings use :func:/:data:/:class: roles and "(ADR-0036: …)". No API page renders them, so this is low impact. Convert if they are ever rendered.
L ferro --help 22 "ferro's command line: schema migrations for ferro models." starts lowercase. Docstrings elsewhere say "Ferro" in prose (33×) and "ferro" (≈400× incl. code). Pick one prose capitalisation for the product name.

Activity

  1. added
    documentationImprovements or additions to documentation
    ready-for-agentUnblocked and fully specified; an agent may claim it
    on Oct 19, 2026
  2. added
    size:SOne context window, <= 3 files; cloud-eligible
    on Oct 19, 2026
  3. added theissue type on Oct 19, 2026
  4. self-assigned this
    on Oct 19, 2026
  5. 0x054 commented on Oct 19, 2026

    @0x054
    ContributorAuthor

    Status: verify-passed
    Worker: sdd worker
    Branch: sdd/702-cli-help-placeholders
    PR: #726
    Verify: passed 57ea0c6

    Review: spec PASS, quality PASS. One Minor: squash help prints literal backticks around new under plaintext. Trial merge not run (base unchanged).

  6. 0x054 commented on Oct 19, 2026

    @0x054
    ContributorAuthor

    Merged in #726 into feat/docs-rewrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationready-for-agentUnblocked and fully specified; an agent may claim itsize:SOne context window, <= 3 files; cloud-eligible

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions