cargo-machete icon indicating copy to clipboard operation
cargo-machete copied to clipboard

How to exclude crates not part of the root crate from analysis

Open mickvangelderen opened this issue 2 years ago • 1 comments

I have a project that includes a git submodule for .proto files. Inside of the submodule there is an example rust crate that has nothing to do with the main repository I am running cargo machete on.

How can I exclude this unrelated crate from the cargo machete analysis?

I can explicitly pass the paths to the projects I want to include, but I just don't like having to do so.

I see multiple possible implementations:

  1. only analyze crates that are members of the workspace if it exists
  2. allow adding paths or directories to ignore in the file system discovery

mickvangelderen avatar Nov 01 '22 13:11 mickvangelderen

Thanks for opening an issue! For background: the --ignore-target option was introduced as a minimal way to ignore directories, so instead we could just use a plain list of directories that we want to ignore, instead, as a generalization of the --ignore-target. That is your option 2, if I understand correctly! Is this something you'd be interested in implementing too?

bnjbvr avatar Nov 01 '22 16:11 bnjbvr