kbknapp / cargo-graph

A cargo subcommand for creating GraphViz DOT files and dependency graphs
BSD 3-Clause "New" or "Revised" License
216 stars 16 forks source link

module graphs? #11

Open flying-sheep opened 9 years ago

flying-sheep commented 9 years ago

hi! i wanted to ask if module dependencies within a crate are out of scope or could be implemented.

surely a bigger thing as we’d have to parse rust…

the utility would be detecting dependency cycles and therefore get help with better module structure.

kbknapp commented 9 years ago

Parsing local modules probably wouldn't be too difficult, but parsing external modules (to include std) would be much more difficult and require the source.

I'll play with some ideas and see what I can figure out.

nixpulvis commented 8 years ago

Having the ability to graph just local module dependencies would help review designs a lot.

asomers commented 6 years ago

I like this idea. And as far as I'm concerned, graphing only local dependencies would actually be better than graphing global modules too. I actually wrote my own version of this tool, but it uses awk and sh, so it's far from perfect. In particular, it doesn't work at all with nested import groups.

asomers commented 6 years ago

Here's a newer crate than produces nice module graphs: https://github.com/regexident/cargo-modules