Skip to content

fix: make CLI default title an opt-in flag - #283

Open
MbappeWU wants to merge 1 commit into
matthewwithanm:developfrom
MbappeWU:fix/cli-default-title
Open

MbappeWU wants to merge 1 commit into
matthewwithanm:developfrom
MbappeWU:fix/cli-default-title

Conversation

@MbappeWU

@MbappeWU MbappeWU commented Oct 5, 2026 •

Copy link
Copy Markdown

The CLI currently adds a fallback link title when --default-title is absent, then disables that behavior when the flag is supplied. Its argparse action is store_false, which reverses the option's documented opt-in meaning.

Use store_true so the default is false and the flag enables href-based titles. Preserve explicit titles, stdin and named-file conversion, and the existing autolinks behavior. Add tests against the public CLI entry function rather than argparse internals. No converter/API, dependency, version, config or source workflow changes.

Validation:

  • Original Python 3.8.20 tox flow: 86 tests pass, flake8 passes, and README reStructuredText lint passes. The unchanged baseline has 83 passing tests. mypy . passes for 14 source files; mypy --strict tests/types.py passes.
  • The exact final CLI test file against the original implementation has 2 failures and 1 pass: default/fallback and autolink assertions expose the reversed behavior; explicit-title preservation already works.
  • Original application workflow in the fork succeeds in both build and types jobs using actual Python 3.8.18. It runs the unchanged tox test/lint/README flow, wheel/sdist build, mypy and strict types check. Only a manual-dispatch event was added on the separate fork CI branch; the source and publishing workflows are unchanged.
  • Real wheel/sdist each contain 4 runtime files, including py.typed, matching final Git. Archive integrity and Twine checks pass. Independent replay of the retained helper plus a semantic checker verifies actual installed console/module stdout, stderr and exit for 7 cases: default/flag, stdin/file, explicit title, autolinks alone and autolinks with fallback titles. The installed environment uses Python 3.8.20 and the declared dependencies.
  • Independent code and input reviews approve. The current complete open-PR diff refresh found no active fix for this option. Upstream workflow execution and maintainer review remain pending approval; no release or package upload was triggered.

@MbappeWU
MbappeWU marked this pull request as ready for review October 5, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant