Skip to content

Commit 6242d3c

Browse files
authored
Add —use-todos-for-layout to configure this explicitly (#51)
1 parent 7341e7f commit 6242d3c

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

bin/visualize_packs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ OptionParser.new do |opt|
1919

2020
opt.on('--no-todo-arrows', "Don't show pack todos") { |o| options.show_todos = false }
2121
opt.on("--only-todo-types=", "Show only the selected types of todos. Comma-separated list of #{EdgeTodoTypes.values.map &:serialize}") { |o| options.only_todo_types = o.to_s.split(",").uniq.map { EdgeTodoTypes.deserialize(_1) } }
22+
opt.on("--use-todos-for-layout", "Show only the selected types of todos. Comma-separated list of #{EdgeTodoTypes.values.map &:serialize}") { |o| options.use_todos_for_layout = true }
2223

2324
opt.on('--no-teams', "Don't show team colors") { |o| options.show_teams = false }
2425

lib/graph.dot.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ digraph package_diagram {
8888
<%- todo_types.keys.each do |todo_type| -%>
8989
<%- if show_edge.call(package.name, todos_to_package) -%>
9090
"<%= package.name -%>" -> "<%= todos_to_package -%>"<%= todo_type == 'privacy' ? ':private' : '' -%> [ color=darkred style=dashed
91-
<%- if options.show_dependencies -%>
91+
<%- if !options.use_todos_for_layout -%>
9292
constraint=false
9393
<%- end -%>
9494
# headlabel="<%= todo_type -%>"

lib/visualize_packs/options.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Options < T::Struct
3232

3333
prop :show_todos, T::Boolean, default: true
3434
prop :only_todo_types, T::Array[EdgeTodoTypes], default: EdgeTodoTypes.values
35+
prop :use_todos_for_layout, T::Boolean, default: false
3536

3637
prop :show_teams, T::Boolean, default: true
3738

spec/diagram_generation_helper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test_names+=("no_legend"); test_params[${test_names[-1]}]="--no-legend"
1919
test_names+=("no_layers"); test_params[${test_names[-1]}]="--no-layers"
2020
test_names+=("no_teams"); test_params[${test_names[-1]}]="--no-teams"
2121

22-
test_names+=("no_dependencies"); test_params[${test_names[-1]}]="--no-dependency-arrows"
22+
test_names+=("no_dependencies"); test_params[${test_names[-1]}]="--no-dependency-arrows --use-todos-for-layout"
2323
test_names+=("no_todos"); test_params[${test_names[-1]}]="--no-todo-arrows"
2424
test_names+=("no_privacy"); test_params[${test_names[-1]}]="--no-privacy-boxes"
2525
test_names+=("no_nested"); test_params[${test_names[-1]}]="--no-nesting-arrows"

0 commit comments

Comments
 (0)