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

feat: allow inspect local workspace packages #66

Merged
merged 4 commits into from
Dec 18, 2023
Merged

Conversation

hi-rustin
Copy link
Owner

@hi-rustin hi-rustin commented Dec 13, 2023

The panic occurred while creating the API registry. Simply disregard the error.

close #60

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Copy link
Owner Author

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@hi-rustin hi-rustin requested a review from epage December 13, 2023 02:40
src/ops/info.rs Show resolved Hide resolved
src/ops/info.rs Outdated
Comment on lines 117 to 121
// Only suggest cargo tree command when the package is not a workspace member.
// For workspace members, `cargo tree --package <SPEC> --invert` is useless. It only prints itself.
let suggest_cargo_tree_command =
ws_inspect_info.package_id.is_some() && !ws_inspect_info.is_member;
let add_is_member_note = ws_inspect_info.is_member;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should generalize this on the PackageId's SourceId's SourceKind.

  • If from default registry, do nothing
  • If from non-default registry, specify that
  • If from git or path, say so

We likely don't care about the level of detail of whether it is a workspace member or not.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Sounds make sense. Thanks!

Copy link
Owner Author

@hi-rustin hi-rustin Dec 17, 2023

Choose a reason for hiding this comment

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

It looks like:
image
image
image

@hi-rustin hi-rustin force-pushed the rustin-patch-ws-pkg branch 2 times, most recently from b94cdbc to 4a2ac07 Compare December 17, 2023 07:18
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Copy link
Owner Author

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

(Some(latest), false) if latest.version() != package_id.version() => {
write!(
stdout,
" {warn}(latest {} {note}from {}{warn}){reset}",
Copy link
Owner Author

Choose a reason for hiding this comment

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

I am not sure if this is a good color choice. Do you have any thoughts?

@@ -1,4 +1,4 @@
my-package
version: 0.4.1+my-package (latest 99999.0.0+my-package)
version: 0.4.1+my-package (latest 99999.0.0+my-package from registry `dummy-registry`)
Copy link
Owner Author

Choose a reason for hiding this comment

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

The latest version and source URL.

@@ -0,0 +1,6 @@
cargo-list-test-fixture
version: 0.2.0 (from [ROOT]/case)
Copy link
Owner Author

Choose a reason for hiding this comment

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

The path URL.

@hi-rustin hi-rustin requested a review from epage December 17, 2023 07:27
@hi-rustin
Copy link
Owner Author

@epage I am going to move forward and merge it. If you have any other comments we can improve it later. I want to merge it to avoid conflicts when making some improvements to the MSRV stuff.

Copy link
Owner Author

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@hi-rustin hi-rustin merged commit ed5f6c9 into main Dec 18, 2023
9 checks passed
@hi-rustin hi-rustin deleted the rustin-patch-ws-pkg branch December 18, 2023 02:40
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.

Panic when you query a local crate with unpublished version under its package root
2 participants