-
Notifications
You must be signed in to change notification settings - Fork 19
/
main_strings.go
91 lines (73 loc) · 4.23 KB
/
main_strings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package main
var (
version = "devel-release"
commit = "unknown-hash"
date = "unknown-date"
)
const (
gomodShort = "A tool to visualise and analyse a Go project's dependency graph."
gomodLong = `A CLI tool for interacting with your Go project's dependency graph on various
levels. See the online documentation or the '--help' for specific sub-commands to discover all the
supported workflows.
NB: The '--verbose' flag available on each command takes an optional list of strings that allow you
to only get verbose output for specific pieces of logic. The available domains are:
* init -> Code that runs before any actual dependency processing happens.
* graph -> Interactions on the underlying graph representation used by 'gomod'.
* modinfo -> Retrieval of information about all modules involved in the dependency graph.
* pkginfo -> Retrieval of information about all packages involves in the dependency graph.
* moddeps -> Retrieval of information about module-level dependency graph (e.g versions).
* parser -> Parsing of user-specified dependency queries.
* query -> Execution of a parsed user-query on the dependency graph.
* printer -> Printing of the queried dependency graph.
* all -> Covers all domains above.
Without any arguments the behaviour defaults to enabling verbosity on all domains, the
equivalent of passing 'all' as argument.
`
graphShort = "Visualise the dependency graph of a Go module."
graphLong = `Generate a visualisation of the dependency network used by the code in your Go
module.
The command requires a query to be passed to determine what part of the graph
should be printed. The query language itself supports the following syntax:
- Exact or prefix path queries: foo.com/bar or foo.com/bar/...
- Inclusion of test-only dependencies: test(foo.com/bar)
- Dependency queries: 'deps(foo.com/bar)' or 'rdeps(foo.com/bar)
- Depth-limited variants of the above: 'deps(foo.com/bar, 5)'
- Recursive removal of single-parent leaf-nodes: shared(foo.com/bar)'
- Various set operations: X + Y, X - Y, X inter Y, X delta Y.
An example query:
gomod graph -p 'deps(foo.com/bar/...) inter deps(test(test.io/pkg/tool))'
The generated graph is colour and format coded:
- Each module, or group of packages belonging to the same module, has a distinct
colour.
- Test-only dependencies are recognisable by the use of a lighter
colour-palette.
- Test-only edges are recognisable by a light blue colour.
- Edges reflecting indirect module dependencies are marked with dashed instead
of continuous lines.
Other visual aspects (when run through the 'dot' tool) can be tuned with the
'--style' flag. You can specify any formatting options as
'<option>=<value>[,<option>=<value>]'
out of the following list:
- 'scale_nodes': one of 'true' or 'false' (default 'false'). This will scale the
size of each node of the graph based on the number of inbound
and outbound dependencies it has.
- 'cluster': one of 'off', 'shared', 'full' (default 'off'). This option
will generate clusters in the image that force the grouping of
shared dependencies together. The result is a tighter graph of
reduced size with less "holes" but which might have less
visible or understandable edges. When set to 'shared' only
dependencies with a single inbound edge are considered and
clustered according to the commonality of that ancestor. When
set to 'full' any two dependencies that have an identical set
of inbound edges are clustered together.
WARNING: Using the 'cluster' option can dramatically increase
the time required to generate image files, especially
for larger dependency graphs. But it's for the latter
that it can also greatly improve the readability of
the final image.
`
analyseShort = `Analyse the graph of dependencies for this Go module and output interesting
statistics.`
revealShort = "Reveal 'hidden' replace'd modules in your direct and direct independencies."
versionShort = "Display the version of the gomod tool."
)