GithubHelp home page GithubHelp logo

dependency-graph's Introduction

dependency graph

树形打印go mod graph

安装

go get -v -u github.com/zoroqi/dependency-graph

cd ${YOUR PROJECT PATH}

dependency-graph

使用

  -ex value
    	exclude package, 排除部分包, 可以多个 -ex xxx -ex yyy
  -expre value
    	exclude package, prefix match, 排除部分包前缀匹配, 可以多个 -expre xxx -expre yyy
  -l int
    	max level 最大打印深度
  -list
    	filter the package in the 'list -m all' result, 基于 `list -m all` 进行过滤
  -p string
    	default: tree print
    	rl: reverse line print
    	rt: reverse tree print
    	wt: whole tree print
    	dot: graphviz print, `xxx | dot -Tsvg -o test.svg` 
  -s string
    	search pkg name, 检索特定的包

打印

  • default
 a
 |-b
 | |-c
 |-d
   |-e
  • rl
c -> b -> a
e -> d -> a
  • rt
 c
 |-b
   |-a

 e
 |-d
   |-a
  • wt
 a
 |-b
   |-c

 a
 |-d
   |-e
  • dot
digraph godeps {
0 [label="a" style="filled"]
1 [label="b" style="filled"]
0 -> 1
}

一些新知识

go mod graph 可以查看依赖关系

go list -m all 查看准确依赖版本, 并不完全准确.

go list -m -u -json all 依赖详细信息

go mod why -m all 查看依赖路径

go mod why -m github.com/xxx/xxx 指定package依赖路径

incompatible代表包没有按照golang的规范进行版本管理 挺好的文档

github.com/xxx/[email protected] 就是不规范的 
github.com/xxx/xxx/[email protected] 就是合规的
github.com/xxx/[email protected] 就是合规的

测试项目snake, 代码不多依赖不少. 特别声明, 尽量设置打印层数.

dependency-graph's People

Contributors

zoroqi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dependency-graph's Issues

依赖树太大

看一个项目, 依赖树打印了660773行, 太多了. 没法看. 需要减少输出量.

  1. 减少重复依赖输出
    • 同一个库只打印一次
    • 同一个库或版本只打印一次
  2. 只输出固定层次
    • 只看前3层
    • 每个依赖最多打印3层

异常项目

annie 项目依赖可能出现过多循环, 导致输出计算时间太长.

需要一个新的裁剪方案.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.