docs: check missing prompts in man-page examples #29875
Update the Makefile comment above .check-self-tests. It still says only xref-helpmsgs-manpages.t is excluded because it needs a built podman; this PR adds xref-helpmsgs-manpages-examples.t to self-tests. A one-line note that example-prompt tests are split out would avoid confusing the next editor.
What about PowerShell or Windows examples? Maybe it would be good to require labeled blocks?
I have some nonblocking nits. Otherwise LGTM!
PTAL @podman-container-tools/podman-maintainers @podman-container-tools/podman-reviewers
Done! Added a comment explaining that the example-prompt tests are separate and do not require a built Podman binary or generated documentation.
PowerShell and Windows examples are excluded from the Unix prompt check when their blocks have an explicit Windows language label. Without a label, a bare podman command would receive the $ / # prompt warning.
I’ve added powershell labels to the four Hyper-V examples, documented the Windows labels, and added regression tests for this behaviour. Windows prompts themselves are not validated.
Example blocks without a language label still receive the prompt check. For this update, I labelled the Windows examples touched by the PR. Would you prefer requiring language labels on all example blocks in this PR, or handling that separately?
LGTM but I dont like the commit message; it seems machine generated.
LGTM, but please adjust the commit msg. Please refer to the issue in this format: Fixes: https://github.com/podman-container-tools/podman/issues/26428
I have updated the commit message. PTAL @Honny1 @baude.
LGTM, Thanks!
PTAL @baude @podman-container-tools/podman-maintainers
LGTM
Honny1
Garvity
Fixes: #26428
Some commands inside existing man-page code fences were missing the $ or # prompt described in
MANPAGE_SYNTAX.md. Added the missing prompts and documented how the new check works.Added a check to
xref-helpmsgs-manpagesfor fenced blocks in EXAMPLE and EXAMPLES sections.It checks unlabelled blocks and blocks labelled
sh,bash,shell, orconsole. After skipping blank lines and###comments, it reports an error if the first remaining line starts with bare podman or sudo podman.The error includes the file and line number.
Only that first remaining line is checked, since later lines may contain command output.
Blocks labelled for Windows shells are excluded from the Unix prompt check.
Added
powershelllabels to the existing Hyper-V example fences.Added regression tests and included them in the tooling self-tests.
These tests do not need a built Podman binary or generated docs.
Also fixed the existing volume-prune test, which still looked for driver and opt rows that were removed from the man page. Using the existing label and until rows restores both checks for a misplaced negated filter and a duplicate filter entry.
<!-- Thanks for sending a pull request! -->
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
<!--
Write
Noneif there are no user-facing changes, otherwise enter your release note below.Include "action required" if users need to take action when upgrading.
-->
``
release-note
``None