EmbarkStudios / cargo-about

📜 Cargo plugin to generate list of all licenses for a crate 🦀
http://embark.rs
Apache License 2.0
545 stars 32 forks source link

Ignore transitive dependencies via config flag #144

Closed haraldreingruber-dedalus closed 2 years ago

haraldreingruber-dedalus commented 3 years ago

For our about box we would just list the direct dependencies. A config flag for ignoring transitive dependencies would be awesome!

Thanks a lot for sharing this really helpful tool 🙏

Jake-Shadle commented 3 years ago

Seems reasonable!

haraldreingruber commented 3 years ago

@Jake-Shadle we might look into working on a PR. I had a quick look into the repo, I guess such an option has to be passed in one way or another to the krates library, where the dependency graph is resolved?

Could you help me to find a potential starting point where the functionality would need to be implemented? I had a look at the krates::builder module, but I did not yet spot the part resolving the transitive dependencies.

Jake-Shadle commented 3 years ago

I think this would be the primary location to change. I think just changing the pid_stack to be a tuple of the package id as well as the depth of the dependency would mean you could just increment the depth when new packages are pushed onto the stack, and then if a depth limit is specified on the builder, just ignoring dependencies at that depth or lower.

Jake-Shadle commented 2 years ago

Closed by #188