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

Fix unused workspace dependency for current dir #691

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix unused workspace dependency for current dir
Jake-Shadle committed Aug 5, 2024
commit 77774099d5fd4612ea3b5e2f3ba5b25d88e63524
4 changes: 3 additions & 1 deletion src/diag/krate_spans.rs
Original file line number Diff line number Diff line change
@@ -766,7 +766,9 @@ fn read_workspace_deps<'k>(
// situations
let dir = km.krate.manifest_path.parent()?;
let path = crate::Path::new(path);
if path.as_str().contains("..") {

// Handle cases of current '.' or parent '..' directories
if path.as_str().contains('.') {
let mut pb = krates.workspace_root().to_owned();
for comp in path.components() {
match comp {
2 changes: 1 addition & 1 deletion tests/test_data/workspace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ spdx = "0.10"
spdx-old = { version = "0.9", package = "spdx" }
spdx-very-old = { version = "0.8", package = "spdx" }
spdx-git = { git = "https://github.com/EmbarkStudios/spdx.git", tag = "0.7.0", package = "spdx" }
member-one = { path = "crates/member-one" }
member-one = { path = "./crates/member-one" }
member-two = { path = "crates/member-two" }
# Validates we can find workspace dependency sources from non-crates.io registries
crate-two = { version = "0.1.0", registry = "embark-deny-git" }