Skip to content

Conversation

@ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Apr 25, 2022

closes ##3421
supersede #3468

- What I did
add support for tab output with non-Latin characters

- How I did it
use a tabwriter for and relie on mattn/go-runewidth to compute columns width

- How to verify it

$ build/docker search twang2218
NAME                       DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
twang2218/gitlab-ce-zh     汉化的 GitLab 社区版 Docker Image               255                  [OK]
twang2218/mysql            MySQL Replication Master/Slave cluster examp…   1                    
twang2218/spark            Apache Spark Docker Image                       0                    [OK]
twang2218/lnmp-nginx       这是 LNMP 示例中的 nginx 镜像                   23                   [OK]

- Description for the changelog
docker tab-aligned output supports non-Latin characters

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

@thaJeztah
Copy link
Member

LOL. wanted to post before/after, but looks like GitHub doesn't render it correctly. So with screenshots;

Before:

Screenshot 2022-04-25 at 14 49 14

After:

Screenshot 2022-04-25 at 14 49 22

Looks like I should check with the Docker Hub team on the sorting BTW; I removed client-side sorting in #3470 (as the result from hub should be in the correct order), but looking at that output, I'm not sure what sorting is used there (at least it's not sorted by stars ⭐ ⭐ ⭐ )

@thaJeztah thaJeztah added this to the 22.04.0 milestone Apr 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2022

Codecov Report

Merging #3568 (fd2bc1f) into master (0b78efe) will increase coverage by 0.37%.
The diff coverage is 90.03%.

@@            Coverage Diff             @@
##           master    #3568      +/-   ##
==========================================
+ Coverage   58.99%   59.36%   +0.37%     
==========================================
  Files         282      285       +3     
  Lines       23813    24097     +284     
==========================================
+ Hits        14049    14306     +257     
- Misses       8908     8930      +22     
- Partials      856      861       +5     

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, thanks!

@ndeloof
Copy link
Contributor Author

ndeloof commented Apr 25, 2022

I also noticed my example output is not well formed on GitHub preview. Seems there's no definitive answer to this issue (other than: get everyone on earth speak French)

@thaJeztah
Copy link
Member

Looks like I should check with the Docker Hub team on the sorting BTW; I removed client-side sorting in #3470 (as the result from hub should be in the correct order), but looking at that output, I'm not sure what sorting is used there (at least it's not sorted by stars ⭐ ⭐ ⭐ )

So apparently, it's sorted by pull_count, which is indeed returned by the search response, but not shown. Will need to check if that was part of the original v1 search API, or a later addition. If it was already present, we can consider to present pull count instead of stars (e.g.), or show both

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.

4 participants