Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove indent when generating Example lines in usage #188

Merged
merged 1 commit into from
May 3, 2024

Conversation

vuil
Copy link
Contributor

@vuil vuil commented May 2, 2024

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

See updated unit tests

Release note

Example lines for a plugin command will be produced without any additional indentation. 
Plugins should refrain from introducing their own custom indentation in any multiline Example fields of their commands.

Additional information

Special notes for your reviewer

@vuil vuil requested a review from a team as a code owner May 2, 2024 20:39
Signed-off-by: Vui Lam <vui.lam@broadcom.com>
@vuil vuil force-pushed the fix-example-indent-in-usage branch from 68d7c2f to b26c6c5 Compare May 2, 2024 20:42
// matches cobra default help template's behavior of not indenting the
// Example value, which has the added benefit of ensuring multiline
// .Example values are aligned
output.WriteString(cmd.Example + "\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider correcting commands that still includes explicit indent in multi-line Example fields, but in the spirit discourage such patterns going foward (because it leads to misalignment of generated markdown docs for said commands), decided not to.

Copy link
Contributor

@prkalle prkalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vuil vuil merged commit 99df044 into vmware-tanzu:main May 3, 2024
4 checks passed
@marckhouzam marckhouzam added this to the v1.3.0 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants