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

Don't trim the crate name from the output #157

Open
jyn514 opened this issue Nov 5, 2021 · 0 comments
Open

Don't trim the crate name from the output #157

jyn514 opened this issue Nov 5, 2021 · 0 comments

Comments

@jyn514
Copy link
Contributor

jyn514 commented Nov 5, 2021

Especially in workspaces, trimming the crate name is very confusing compared to the alternative. Without the crate name:

Found invalid urls in struct.FileError.html:
	Fragment #tymethod.deref at struct.FileError.html does not exist!
Found invalid urls in struct.CheckContext.html:
	Fragment #tymethod.init at struct.CheckContext.html does not exist!
Found invalid urls in struct.FileError.html:
	Fragment #tymethod.deref at struct.FileError.html does not exist!

With:

Found invalid urls in deadlinks/struct.MainArgs.html:
	Fragment #tymethod.deref at deadlinks/struct.MainArgs.html does not exist!
Found invalid urls in deadlinks/shared/struct.PicoError.html:
	Fragment #tymethod.deref_mut at deadlinks/shared/struct.PicoError.html does not exist!
Found invalid urls in cargo_deadlinks/struct.FileError.html:
	Fragment #tymethod.deref at cargo_deadlinks/struct.FileError.html does not exist!

The issue is that cargo-deadlinks is calling walk_dir on a single crate at a time (to avoid checking more crates than necessary, e.g. if you have a shared target dir):

if walk_dir(&dir, &ctx) {

which means that whole directory prefix is stripped:
err.shorten_all(dir_path);

Not sure what the correct fix is. Maybe the library can add yet another argument to prefix the shortened name with the crate name?

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

No branches or pull requests

1 participant