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 preceding white space from cobra help template #5730

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

thelovekesh
Copy link
Contributor

While printing the usage text, I noticed there is always a empty line before the usage text. This was due to not using trim marker in cobra help text template. This PR fixes that.

- What I did
Remove preceding white space from cobra help template

- How I did it
Add a trim marker before printing the help template.

- How to verify it
Before:

$ ./build/docker                              

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

...

Build the cli on this branch and re-run the binary. Now it will output:

$ ./build/docker
Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

...

Please note the there is no line before usage text.

- Description for the changelog

Remove preceding white space from cobra help template

- A picture of a cute animal (not mandatory but encouraged)

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.26%. Comparing base (7a72f38) to head (61a3b4b).
Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5730   +/-   ##
=======================================
  Coverage   59.26%   59.26%           
=======================================
  Files         353      353           
  Lines       29540    29540           
=======================================
  Hits        17508    17508           
  Misses      11052    11052           
  Partials      980      980           

Signed-off-by: thelovekesh <[email protected]>
Signed-off-by: Lovekesh Kumar <[email protected]>
@thaJeztah thaJeztah force-pushed the update/help-template branch from d5d449b to 61a3b4b Compare February 10, 2025 09:53
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

I did a quick rebase and squash of the two commits; I'll merge if CI is happy 😄

@thelovekesh
Copy link
Contributor Author

Is the failing test related?

@thaJeztah
Copy link
Member

Nope; looks like a flaky test - I kicked CI to run again;

@thaJeztah
Copy link
Member

All green now 🎉

@thaJeztah thaJeztah merged commit e6ee7ea into docker:master Feb 10, 2025
89 checks passed
@thelovekesh thelovekesh deleted the update/help-template branch February 10, 2025 18:16
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.

3 participants