Skip to content

Fix alignment of client built time in version output - #769

Closed
leanderjanssen wants to merge 1 commit into
docker:masterfrom
leanderjanssen:fix_version_output
Closed

Fix alignment of client built time in version output#769
leanderjanssen wants to merge 1 commit into
docker:masterfrom
leanderjanssen:fix_version_output

Conversation

@leanderjanssen

Copy link
Copy Markdown

- What I did
Add one more tab to the Built time to align the output of the docker client version.

- How to verify it

Before:

$ docker version
Client:
 Version:	18.01.0-dev
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	c97c6d6
 Built:	Wed Dec 27 20:11:19 2017
 OS/Arch:	linux/amd64
 Experimental:	false

After:

$ docker version
Client:
 Version:	18.01.0-dev
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	0dd05ac1
 Built:		Thu Dec 28 09:19:35 2017
 OS/Arch:	linux/amd64
 Experimental:	false

- Description for the changelog

Fix alignment of client built time in version output

Signed-off-by: Leander Janssen leander@slaco.net

Signed-off-by: Leander Janssen <leander@slaco.net>
@codecov-io

codecov-io commented Dec 28, 2017

Copy link
Copy Markdown

Codecov Report

Merging #769 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #769   +/-   ##
=======================================
  Coverage   53.46%   53.46%           
=======================================
  Files         218      218           
  Lines       14642    14642           
=======================================
  Hits         7829     7829           
  Misses       6327     6327           
  Partials      486      486

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah! I think the alignment was due to a bug in the tabwriter, and this would not be the correct fix

ping @tiborvass PTAL

@leanderjanssen

Copy link
Copy Markdown
Author

In GitHub this looks a bit weird, but in the actual code a single tab character is used.
Because the word Built is so short compared with the rest, two tabs are required to align it correctly.

@thaJeztah

Copy link
Copy Markdown
Member

The tabwriter is meant to convert the tabs to spaces during presentation, so that the columns are always aligned properly. There was a bug in the tabwriter though, that caused the alignment to not work properly, so it was temporarily disabled (IIRC).

I'm not exactly sure what the bug was, but @tiborvass mentioned that, so I guess he knows more. If that is resolved, alignment should work again (and this change would not be needed)

@leanderjanssen

Copy link
Copy Markdown
Author

Ah I see, I was actually quite surprised to see hard tabs in the code.

@vdemeester

Copy link
Copy Markdown
Collaborator

ping @tiborvass

@tiborvass

Copy link
Copy Markdown
Collaborator

Ugh, sorry for delay on this, thanks @leanderjanssen, but we need to use tabwriter here and I remember having some issues with it. If you want to tackle it let me know otherwise I'll try.

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🐯
Let's go for that now and we'll see how to make it better later 👼

@thaJeztah

Copy link
Copy Markdown
Member

opened #965, using tabwriter

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.

6 participants