fix CLI help example indentation#28196
Conversation
a3d4d09 to
ae8c370
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
I think I like it. LGTM. |
Honny1
left a comment
There was a problem hiding this comment.
LGTM overall, just two minor style comments (non-blocking).
lsm5
left a comment
There was a problem hiding this comment.
change LGTM.
Please squash into a single commit after addressing other comments.
f5a8968 to
8b3f2de
Compare
|
LGTM |
|
@MayorFaj, I think you may be running into an issue with our build machines that was fixed earlier today. Could you please rebase and try pushing again? |
8b3f2de to
dbc9ea6
Compare
|
done |
|
@MayorFaj could you PTAL at the failing tests? |
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
5a90ffb to
31b956e
Compare
all good now, the only failing test is not related to the PR |
Honny1
left a comment
There was a problem hiding this comment.
LGTM. I reran the failed tests.
Description
Go backtick (raw) string literals preserve all whitespace verbatim, including tabs and spaces from source code indentation. When Cobra renders the Example field in --help output, multi-line examples that were indented in source appeared with incorrect whitespace, some had tabs, others had 3 spaces, and some were flush-left.
Fix: Added an indentExamples template function registered via cobra.AddTemplateFunc that normalizes all Example strings to exactly 2-space indentation and strips leading/trailing blank lines. Updated the usage template to pipe through this function ({{.Example | indentExamples}}), and converted all ~95 multi-line Example fields across podman to flush-left raw strings so the template function handles indentation uniformly.
This is a defensive, centralized approach, future contributors simply write flush-left example strings in backticks, and the template function ensures correct display.
Checklist
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: #28178in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
Fixes: #28178