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

feat(graph): also generate the transitive reduction #9359

Merged
merged 4 commits into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/graph.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
# Generates visualizations of the internal package dependency graph.
# Also generates visualizations of the transitive reduction (tred) of
# that graph, which is the minimal graph with the same *transitive*
# dependencies. Much more legible by itelf. Seeing the two side by side
# often helps to understand the full picture.
set -ueo pipefail
DIR=$(dirname -- "${BASH_SOURCE[0]}")
{
Expand All @@ -25,6 +29,10 @@ dot -Tpng < packages-graph.dot > "$DIR"/../packages-graph.png

dot -Tsvg < packages-graph.dot > "$DIR"/../packages-graph.svg

tred < packages-graph.dot > packages-graph-tred.dot
dot -Tpng < packages-graph-tred.dot > "$DIR"/../packages-graph-tred.png
dot -Tsvg < packages-graph-tred.dot > "$DIR"/../packages-graph-tred.svg

if acyclic packages-graph.dot | dot -Tcanon > packages-graph-sans-cycles.dot; then
echo 1>&2 "No cycles in 'dependencies' of packages."
else
Expand Down