Closed kjeremy closed 1 month ago
This has been really helpful for my team. What do I need to do to get it merged?
The problem with showing descriptions in nix flake show
is that they can be pretty long, which can break the tree output rendering (especially if they contain newlines).
@edolstra I can think of a few approaches:
I can tackle either one if I get some direction.
I've pushed a change to stop at the first new line
I'm not quite sure how to test the output. The tests in tests/functional/flakes/show.sh
all depend on the json
output but this needs to check stdout.
As a bystander, I think the following implementation might make the most sense:
description
until you get to a non-whitespace characterI'm not quite sure how to test the output. The tests in
tests/functional/flakes/show.sh
all depend on thejson
output but this needs to check stdout.
You could try using <the command> | grepQuiet "what you're looking for"
, I think.
I chose 80 and added tests.
@edolstra is this a reasonable solution to the tree rendering?
@Ericson2314 is there any thing I can do to move this along?
It looks like lix
just merged this into their code base.
I think the macos test failure is spurious
I tried this out and I still get overflow. Am I reading the logic wrong? Shouldn't the window size limitation be on the entire string rather than only the desc
?
logger->cout("%s: %s '%s' - '%s'", headerPrefix, type, name, desc);
^-----------------^
I guess it could be. I was thinking it should just be on the description but maybe it should be on the whole string but we should only cut off the description if too long to match existing behavior
Tested and works as expected. Thanks!
Motivation
Displays the description of the package if it exists. This information is already present in the json output.
I have a flake with many packages and dev shells and this helps discoverability.
Context
10977
Priorities and Process
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.