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

Print labels with their colors on lab label list #888

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zampierilucas
Copy link
Collaborator

@zampierilucas zampierilucas commented Feb 16, 2024

This takes the label.Color hex and converts it to color in HexToRGB in utils, then uses is to set the background color.

Closes: #887

This takes the label.color hex and converts it to color in HexToRGB in
utils, then uses rgbterm lib to convert rgb to terminal color.

Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
@zampierilucas
Copy link
Collaborator Author

This is what the labels look like with the change.
image

@teto
Copy link

teto commented Feb 20, 2024

as a go noob , I was not able to run the PR from the folder via MYGITLABREPO $ go run ~/lab/main.go -- label list because it couldn't find the go modules so I tried go build -o toto -mod=readonly but it asked for a go mod tidy ? after that I was able to run ~/lab/toto label list and it worked beautifully ty.

@prarit
Copy link
Collaborator

prarit commented Feb 20, 2024

I like this change but I think it should be optional. @zampierilucas I think you should add a config option for this to enable the colors. That way users can set it in their lab.toml and not worry about it.

Label colored printing can be enabled by the --color param, or by using
the config file.

Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
@zampierilucas
Copy link
Collaborator Author

@prarit I've updated my mr with you suggestion.

title

Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
Copy link
Collaborator

@bmeneg bmeneg left a comment

Choose a reason for hiding this comment

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

We can make this change generic to every lab command.
Since it's a bigger change, this one is fine wrt the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show label colors in terminal
4 participants