packs 0.0.41 → 0.0.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/packs/cli.rb +5 -5
- data/lib/packs/private/interactive_cli/use_cases/get_info.rb +1 -1
- data/lib/packs/private/interactive_cli/use_cases/query.rb +1 -1
- data/lib/packs/private.rb +13 -13
- data/lib/packs.rb +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc08064feda47e2bf0a7946b47c62f747f4024ea66fedbd0358cced98703ff7d
|
4
|
+
data.tar.gz: 3b720e41762061c7d3a150579e97623d2c8202d220d7227bf38b478f994f29e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e798e2a7ab7dc26e2ca3a6e46eea32843e3e6197b40d47ecb1c552d7d0b8df3bc5dcceb99aa3266a33b9aef6a2332ee649875254dd9f3cbdc5c4886138bfdcee
|
7
|
+
data.tar.gz: 662a21d82b0b69b6102ccdeb5411324d0ea60e50a729255b42524571a5e7a568ae81ca33b1f2eb39d48a5d51ab3f9755eac063f371c0d9a602736c8d24c80a00
|
data/README.md
CHANGED
@@ -64,13 +64,13 @@ This command will also sort the list and make it unique.
|
|
64
64
|
## List the top violations of a specific type for packs/your_pack.
|
65
65
|
`bin/packs list_top_violations type [ packs/your_pack ]`
|
66
66
|
|
67
|
-
Possible types are: dependency, privacy,
|
67
|
+
Possible types are: dependency, privacy, layer.
|
68
68
|
|
69
69
|
Want to see who is depending on you? Not sure how your pack's code is being used in an unstated way? You can use this command to list the top dependency violations.
|
70
70
|
|
71
71
|
Want to create interfaces? Not sure how your pack's code is being used? You can use this command to list the top privacy violations.
|
72
72
|
|
73
|
-
Want to focus on the big picture first? You can use this command to list the top
|
73
|
+
Want to focus on the big picture first? You can use this command to list the top layer violations.
|
74
74
|
|
75
75
|
If no pack name is passed in, this will list out violations across all packs.
|
76
76
|
|
data/lib/packs/cli.rb
CHANGED
@@ -9,14 +9,14 @@ module Packs
|
|
9
9
|
desc 'create packs/your_pack', 'Create pack with name packs/your_pack'
|
10
10
|
option :enforce_dependencies, type: :boolean, default: nil, aliases: :d, banner: 'Enforce dependencies'
|
11
11
|
option :enforce_privacy, type: :boolean, default: true, aliases: :p, banner: 'Enforce privacy'
|
12
|
-
option :
|
12
|
+
option :enforce_layers, type: :boolean, default: true, aliases: :a, banner: 'Enforce layers'
|
13
13
|
sig { params(pack_name: String).void }
|
14
14
|
def create(pack_name)
|
15
15
|
Packs.create_pack!(
|
16
16
|
pack_name: pack_name,
|
17
17
|
enforce_dependencies: options[:enforce_dependencies],
|
18
18
|
enforce_privacy: options[:enforce_privacy],
|
19
|
-
|
19
|
+
enforce_layers: options[:enforce_layers]
|
20
20
|
)
|
21
21
|
exit_successfully
|
22
22
|
end
|
@@ -39,7 +39,7 @@ module Packs
|
|
39
39
|
exit_successfully
|
40
40
|
end
|
41
41
|
|
42
|
-
POSIBLE_TYPES = T.let(%w[dependency privacy
|
42
|
+
POSIBLE_TYPES = T.let(%w[dependency privacy layer], T::Array[String])
|
43
43
|
desc 'list_top_violations type [ packs/your_pack ]', 'List the top violations of a specific type for packs/your_pack.'
|
44
44
|
long_desc <<~LONG_DESC
|
45
45
|
Possible types are: #{POSIBLE_TYPES.join(', ')}.
|
@@ -48,7 +48,7 @@ module Packs
|
|
48
48
|
|
49
49
|
Want to create interfaces? Not sure how your pack's code is being used? You can use this command to list the top privacy violations.
|
50
50
|
|
51
|
-
Want to focus on the big picture first? You can use this command to list the top
|
51
|
+
Want to focus on the big picture first? You can use this command to list the top layer violations.
|
52
52
|
|
53
53
|
If no pack name is passed in, this will list out violations across all packs.
|
54
54
|
LONG_DESC
|
@@ -131,7 +131,7 @@ module Packs
|
|
131
131
|
desc 'get_info [ packs/my_pack packs/my_other_pack ]', 'Get info about size and violations for packs'
|
132
132
|
option :include_date, type: :boolean, default: false, aliases: :d, banner: "Include today's date as part of the data (useful to take snapshots over time)"
|
133
133
|
option :format, type: :string, default: 'detail', aliases: :f, banner: 'Specify the output format (detail, csv)'
|
134
|
-
option :types, type: :string, default: 'privacy,dependency', aliases: :t, banner: 'List of validation types to include (privacy,dependency,
|
134
|
+
option :types, type: :string, default: 'privacy,dependency', aliases: :t, banner: 'List of validation types to include (privacy,dependency,layer)'
|
135
135
|
sig { params(pack_names: String).void }
|
136
136
|
def get_info(*pack_names)
|
137
137
|
selected_types = options[:types].to_s.downcase.split(',')
|
@@ -30,7 +30,7 @@ module Packs
|
|
30
30
|
|
31
31
|
types = prompt.multi_select(
|
32
32
|
'What violation types do you want stats for?',
|
33
|
-
%w[Privacy Dependency
|
33
|
+
%w[Privacy Dependency Layer]
|
34
34
|
)
|
35
35
|
|
36
36
|
include_date = !prompt.no?('Should the current date be included in the report?')
|
@@ -30,7 +30,7 @@ module Packs
|
|
30
30
|
|
31
31
|
limit = prompt.ask('Specify the limit of constants to analyze', default: 10, convert: :integer)
|
32
32
|
|
33
|
-
selection = prompt.select('Are you interested in dependency, or
|
33
|
+
selection = prompt.select('Are you interested in dependency, privacy, or layer violations?', %w[Dependency Privacy Layer], default: 'Privacy')
|
34
34
|
|
35
35
|
Packs.list_top_violations(
|
36
36
|
type: selection.downcase,
|
data/lib/packs/private.rb
CHANGED
@@ -49,11 +49,11 @@ module Packs
|
|
49
49
|
pack_name: String,
|
50
50
|
enforce_dependencies: T.nilable(T::Boolean),
|
51
51
|
enforce_privacy: T::Boolean,
|
52
|
-
|
52
|
+
enforce_layers: T::Boolean,
|
53
53
|
team: T.nilable(CodeTeams::Team)
|
54
54
|
).void
|
55
55
|
end
|
56
|
-
def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:,
|
56
|
+
def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team:)
|
57
57
|
Logging.section('👋 Hi!') do
|
58
58
|
intro = Packs.config.user_event_logger.before_create_pack(pack_name)
|
59
59
|
Logging.print_bold_green(intro)
|
@@ -65,7 +65,7 @@ module Packs
|
|
65
65
|
pack_name: pack_name,
|
66
66
|
enforce_dependencies: enforce_dependencies,
|
67
67
|
enforce_privacy: enforce_privacy,
|
68
|
-
|
68
|
+
enforce_layers: enforce_layers,
|
69
69
|
team: team
|
70
70
|
)
|
71
71
|
add_public_directory(package) if package.enforce_privacy
|
@@ -169,7 +169,7 @@ module Packs
|
|
169
169
|
name: new_package_name,
|
170
170
|
enforce_dependencies: package.enforce_dependencies,
|
171
171
|
enforce_privacy: package.enforce_privacy,
|
172
|
-
|
172
|
+
enforce_layers: package.enforce_layers,
|
173
173
|
dependencies: package.dependencies,
|
174
174
|
violations: package.violations,
|
175
175
|
metadata: package.metadata,
|
@@ -206,7 +206,7 @@ module Packs
|
|
206
206
|
name: other_package.name,
|
207
207
|
enforce_dependencies: other_package.enforce_dependencies,
|
208
208
|
enforce_privacy: other_package.enforce_privacy,
|
209
|
-
|
209
|
+
enforce_layers: other_package.enforce_layers,
|
210
210
|
dependencies: new_dependencies.uniq.sort,
|
211
211
|
violations: other_package.violations,
|
212
212
|
metadata: other_package.metadata,
|
@@ -251,7 +251,7 @@ module Packs
|
|
251
251
|
pack_name: parent_name,
|
252
252
|
enforce_dependencies: true,
|
253
253
|
enforce_privacy: true,
|
254
|
-
|
254
|
+
enforce_layers: true
|
255
255
|
)
|
256
256
|
end
|
257
257
|
|
@@ -263,7 +263,7 @@ module Packs
|
|
263
263
|
name: new_package_name,
|
264
264
|
enforce_privacy: package.enforce_privacy,
|
265
265
|
enforce_dependencies: package.enforce_dependencies,
|
266
|
-
|
266
|
+
enforce_layers: package.enforce_layers,
|
267
267
|
dependencies: package.dependencies,
|
268
268
|
violations: package.violations,
|
269
269
|
metadata: package.metadata,
|
@@ -306,7 +306,7 @@ module Packs
|
|
306
306
|
name: other_package.name,
|
307
307
|
enforce_dependencies: other_package.enforce_dependencies,
|
308
308
|
enforce_privacy: other_package.enforce_privacy,
|
309
|
-
|
309
|
+
enforce_layers: other_package.enforce_layers,
|
310
310
|
dependencies: new_dependencies.uniq.sort,
|
311
311
|
violations: other_package.violations,
|
312
312
|
metadata: other_package.metadata,
|
@@ -398,7 +398,7 @@ module Packs
|
|
398
398
|
name: pack_name,
|
399
399
|
dependencies: (package.dependencies + [dependency_name]).uniq.sort,
|
400
400
|
enforce_privacy: package.enforce_privacy,
|
401
|
-
|
401
|
+
enforce_layers: package.enforce_layers,
|
402
402
|
enforce_dependencies: package.enforce_dependencies,
|
403
403
|
violations: package.violations,
|
404
404
|
metadata: package.metadata,
|
@@ -466,11 +466,11 @@ module Packs
|
|
466
466
|
pack_name: String,
|
467
467
|
enforce_dependencies: T.nilable(T::Boolean),
|
468
468
|
enforce_privacy: T::Boolean,
|
469
|
-
|
469
|
+
enforce_layers: T::Boolean,
|
470
470
|
team: T.nilable(CodeTeams::Team)
|
471
471
|
).returns(ParsePackwerk::Package)
|
472
472
|
end
|
473
|
-
def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:,
|
473
|
+
def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team: nil)
|
474
474
|
allowed_locations = Packs::Specification.config.pack_paths
|
475
475
|
if allowed_locations.none? { |location| File.fnmatch(location, pack_name) }
|
476
476
|
raise StandardError, "Packs only supports packages in the the following directories: #{allowed_locations}. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`."
|
@@ -493,7 +493,7 @@ module Packs
|
|
493
493
|
package = ParsePackwerk::Package.new(
|
494
494
|
enforce_dependencies: should_enforce_dependencies || false,
|
495
495
|
enforce_privacy: enforce_privacy,
|
496
|
-
|
496
|
+
enforce_layers: enforce_layers,
|
497
497
|
dependencies: [],
|
498
498
|
violations: [],
|
499
499
|
metadata: {},
|
@@ -600,7 +600,7 @@ module Packs
|
|
600
600
|
include_date: T::Boolean
|
601
601
|
).void
|
602
602
|
end
|
603
|
-
def self.get_info(packs: Packs.all, format: :detail, types: %i[privacy dependency
|
603
|
+
def self.get_info(packs: Packs.all, format: :detail, types: %i[privacy dependency layer], include_date: false)
|
604
604
|
require 'csv' if format == :csv
|
605
605
|
|
606
606
|
today = Date.today.iso8601
|
data/lib/packs.rb
CHANGED
@@ -49,7 +49,7 @@ module Packs
|
|
49
49
|
params(
|
50
50
|
pack_name: String,
|
51
51
|
enforce_privacy: T::Boolean,
|
52
|
-
|
52
|
+
enforce_layers: T::Boolean,
|
53
53
|
enforce_dependencies: T.nilable(T::Boolean),
|
54
54
|
team: T.nilable(CodeTeams::Team)
|
55
55
|
).void
|
@@ -57,7 +57,7 @@ module Packs
|
|
57
57
|
def self.create_pack!(
|
58
58
|
pack_name:,
|
59
59
|
enforce_privacy: true,
|
60
|
-
|
60
|
+
enforce_layers: true,
|
61
61
|
enforce_dependencies: nil,
|
62
62
|
team: nil
|
63
63
|
)
|
@@ -65,7 +65,7 @@ module Packs
|
|
65
65
|
pack_name: pack_name,
|
66
66
|
enforce_privacy: enforce_privacy,
|
67
67
|
enforce_dependencies: enforce_dependencies,
|
68
|
-
|
68
|
+
enforce_layers: enforce_layers,
|
69
69
|
team: team
|
70
70
|
)
|
71
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.25.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.25.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rainbow
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
344
|
- !ruby/object:Gem::Version
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
|
-
rubygems_version: 3.5.
|
347
|
+
rubygems_version: 3.5.9
|
348
348
|
signing_key:
|
349
349
|
specification_version: 4
|
350
350
|
summary: Provides CLI tools for working with ruby packs.
|