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

graph: collapsing modules, internal and arbitrary keywords #41

Open
egonelbre opened this issue Dec 29, 2020 · 2 comments
Open

graph: collapsing modules, internal and arbitrary keywords #41

egonelbre opened this issue Dec 29, 2020 · 2 comments

Comments

@egonelbre
Copy link
Member

During output it would be nice to collapse some particular nodes into a single node.

For example, these could be collapsed:

  1. modules
  2. */internal/*
  3. golang.org/x/tools/*
  4. everything except the project module (or multiple modules)

This sounds like pkggraph needs collapsing and uncollapsing capabilities so that the code can be written as:

goda graph -m .
goda graph -collapse "*/internal/*" .
goda graph -collapse "golang.org/x/tools/*" .

# combining all together
goda graph -m -uncollapse github.com/loov/goda -collapse "*/internal/*" .
@egonelbre egonelbre changed the title Collapsing modules, internal and arbitrary keywords graph: collapsing modules, internal and arbitrary keywords Feb 27, 2021
@dolmen
Copy link
Contributor

dolmen commented Jun 4, 2021

I have an independent experimental project (not yet published on GitHub: I need a name) that makes a graph packages, using modules as clusters. I think that hiding packages internal to a module (packages which do not link to packages from other modules, besides stdlib) is helpful to make the graph more readable.

@iskunk
Copy link

iskunk commented Mar 4, 2022

For what it's worth, point 1 alone would be enough for my usage. I am using the output of goda with an application that normally parses the output of go list -m all and go mod graph, and nodes that are not present in the former listing are unrecognized. (This is in tandem with a third-party database that uses the module paths as keys, so I can't just replace the go list output with goda's.)

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

3 participants