visualize_packs 0.5.12 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/visualize_packs.rb +16 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd8d04886b359c5fe0ee721ba30aa63a82cf15cbbd49f4f22aae9bb122d746da
|
4
|
+
data.tar.gz: f3e546e753e571226f782fe8aa2ae9cbee845c3629964cd8eedaf1527fc77f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b4d5aeb2ac339bb16a731d66733b47dd4d3583adbd099064a3bcd2c2cd77d56ded62cd64128cf7e992108227f91fa32667622e461e42ed49dcee60cf16fc7d
|
7
|
+
data.tar.gz: 3c07f47b89313c37d062550289ca28591a0d2a2023c7fb3f23f401a27710cad28eff6df42775108429af7193374088d0ad9c690599c64c2ad8b0352e921c076c
|
data/lib/visualize_packs.rb
CHANGED
@@ -12,13 +12,12 @@ module VisualizePacks
|
|
12
12
|
sig { params(options: Options, raw_config: T::Hash[String, T.untyped], packages: T::Array[ParsePackwerk::Package]).returns(String) }
|
13
13
|
def self.package_graph!(options, raw_config, packages)
|
14
14
|
all_packages = filtered(packages, options).compact.sort_by {|x| x.name }
|
15
|
-
all_package_names = all_packages.map &:name
|
16
|
-
|
17
15
|
all_packages = remove_nested_packs(all_packages, options)
|
16
|
+
all_package_names = all_packages.map &:name
|
18
17
|
|
19
18
|
show_edge = show_edge_builder(options, all_package_names)
|
20
19
|
node_color = node_color_builder()
|
21
|
-
max_todo_count = max_todo_count(all_packages, show_edge)
|
20
|
+
max_todo_count = max_todo_count(all_packages, show_edge, options)
|
22
21
|
|
23
22
|
title = diagram_title(options, max_todo_count)
|
24
23
|
|
@@ -130,17 +129,21 @@ module VisualizePacks
|
|
130
129
|
end
|
131
130
|
end
|
132
131
|
|
133
|
-
sig { params(all_packages: T::Array[ParsePackwerk::Package], show_edge: T.proc.params(arg0: String, arg1: String).returns(T::Boolean)).returns(T.nilable(Integer)) }
|
134
|
-
def self.max_todo_count(all_packages, show_edge)
|
132
|
+
sig { params(all_packages: T::Array[ParsePackwerk::Package], show_edge: T.proc.params(arg0: String, arg1: String).returns(T::Boolean), options: Options).returns(T.nilable(Integer)) }
|
133
|
+
def self.max_todo_count(all_packages, show_edge, options)
|
135
134
|
todo_counts = {}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
135
|
+
if options.show_todos
|
136
|
+
all_packages.each do |package|
|
137
|
+
todos_by_package = package.violations&.group_by(&:to_package_name)
|
138
|
+
todos_by_package&.keys&.each do |todos_to_package|
|
139
|
+
todo_types = todos_by_package&& todos_by_package[todos_to_package]&.group_by(&:type)
|
140
|
+
todo_types&.keys&.each do |todo_type|
|
141
|
+
if options.only_todo_types.empty? || options.only_todo_types.include?(todo_type)
|
142
|
+
if show_edge.call(package.name, todos_to_package)
|
143
|
+
key = "#{package.name}->#{todos_to_package}:#{todo_type}"
|
144
|
+
todo_counts[key] = todo_types && todo_types[todo_type]&.count
|
145
|
+
end
|
146
|
+
end
|
144
147
|
end
|
145
148
|
end
|
146
149
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visualize_packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|