-
Notifications
You must be signed in to change notification settings - Fork 760
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
Skip invalid tools in uv tool list
#5156
Conversation
uv tool list
3ac204e
to
10f554c
Compare
crates/uv/src/commands/tool/list.rs
Outdated
// Skip invalid tools | ||
let Ok(tool) = tool else { | ||
warn_user!( | ||
"Ignoring malformed tool `{name}` (use {} to remove)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Ignoring malformed tool `{name}` (use {} to remove)", | |
"Ignoring malformed tool `{name}` (use `{}` to remove)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's green though so I intentionally omitted this, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I don't think the color is enough alone (and it's not great for users with colorblindness or colors turned off).
crates/uv/tests/tool_list.rs
Outdated
@@ -84,8 +84,7 @@ fn tool_list_missing_receipt() { | |||
|
|||
----- stderr ----- | |||
warning: `uv tool list` is experimental and may change without warning. | |||
warning: Ignoring malformed tool `black`: missing receipt | |||
No tools installed | |||
warning: Ignoring malformed tool `black` (use uv tool uninstall black to remove) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Ignoring malformed tool `black` (use uv tool uninstall black to remove) | |
warning: Ignoring malformed tool `black` (use `uv tool uninstall black` to remove) |
Summary
Makes the
tools()
return value include per-tool errors. This makes it easy to skip (rather than failing) inuv tool list
, and improvesuv tool uninstall
to remove those invalid tools, rather than leaving them around. (We already had that behavior foruv tool uninstall ruff
with an invalidruff
, butuv tool uninstall --all
just left them.)Closes #5151.