Skip to content

Commit 913b4bb

Browse files
rename architecture to layers (#158)
* rename architecture to layers Co-authored-by: Teal Stannard <teal.stannard@gusto.com> * bump gem version 0.0.42 => 0.0.43 Co-authored-by: Teal Stannard <teal.stannard@gusto.com> * update packs-specification rbi Co-authored-by: Teal Stannard <teal.stannard@gusto.com> * rename architecture -> layer in get_info Co-authored-by: Teal Stannard <teal.stannard@gusto.com> --------- Co-authored-by: Teal Stannard <teal.stannard@gusto.com>
1 parent 09708d0 commit 913b4bb

File tree

13 files changed

+85
-84
lines changed

13 files changed

+85
-84
lines changed

Gemfile.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ GIT
1717
PATH
1818
remote: .
1919
specs:
20-
packs (0.0.42)
20+
packs (0.0.43)
2121
bigdecimal
2222
code_ownership (>= 1.33.0)
2323
packs-specification
2424
packwerk
25-
parse_packwerk (>= 0.22.0, <= 0.23.0)
25+
parse_packwerk (>= 0.25.0)
2626
rainbow
2727
sorbet-runtime
2828
thor
@@ -85,7 +85,8 @@ GEM
8585
packs-specification (0.0.10)
8686
sorbet-runtime
8787
parallel (1.23.0)
88-
parse_packwerk (0.22.0)
88+
parse_packwerk (0.25.0)
89+
bigdecimal
8990
sorbet-runtime
9091
parser (3.2.2.3)
9192
ast (~> 2.4.1)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ This command will also sort the list and make it unique.
6464
## List the top violations of a specific type for packs/your_pack.
6565
`bin/packs list_top_violations type [ packs/your_pack ]`
6666
67-
Possible types are: dependency, privacy, architecture.
67+
Possible types are: dependency, privacy, layer.
6868
6969
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.
7070
7171
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.
7272
73-
Want to focus on the big picture first? You can use this command to list the top architecture violations.
73+
Want to focus on the big picture first? You can use this command to list the top layer violations.
7474
7575
If no pack name is passed in, this will list out violations across all packs.
7676

lib/packs.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ def self.check(files)
4949
params(
5050
pack_name: String,
5151
enforce_privacy: T::Boolean,
52-
enforce_architecture: T::Boolean,
52+
enforce_layers: T::Boolean,
5353
enforce_dependencies: T.nilable(T::Boolean),
5454
team: T.nilable(CodeTeams::Team)
5555
).void
5656
end
5757
def self.create_pack!(
5858
pack_name:,
5959
enforce_privacy: true,
60-
enforce_architecture: true,
60+
enforce_layers: true,
6161
enforce_dependencies: nil,
6262
team: nil
6363
)
6464
Private.create_pack!(
6565
pack_name: pack_name,
6666
enforce_privacy: enforce_privacy,
6767
enforce_dependencies: enforce_dependencies,
68-
enforce_architecture: enforce_architecture,
68+
enforce_layers: enforce_layers,
6969
team: team
7070
)
7171
end

lib/packs/cli.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class CLI < Thor
99
desc 'create packs/your_pack', 'Create pack with name packs/your_pack'
1010
option :enforce_dependencies, type: :boolean, default: nil, aliases: :d, banner: 'Enforce dependencies'
1111
option :enforce_privacy, type: :boolean, default: true, aliases: :p, banner: 'Enforce privacy'
12-
option :enforce_architecture, type: :boolean, default: true, aliases: :a, banner: 'Enforce architecture'
12+
option :enforce_layers, type: :boolean, default: true, aliases: :a, banner: 'Enforce layers'
1313
sig { params(pack_name: String).void }
1414
def create(pack_name)
1515
Packs.create_pack!(
1616
pack_name: pack_name,
1717
enforce_dependencies: options[:enforce_dependencies],
1818
enforce_privacy: options[:enforce_privacy],
19-
enforce_architecture: options[:enforce_architecture]
19+
enforce_layers: options[:enforce_layers]
2020
)
2121
exit_successfully
2222
end
@@ -39,7 +39,7 @@ def add_dependency(from_pack, to_pack)
3939
exit_successfully
4040
end
4141

42-
POSIBLE_TYPES = T.let(%w[dependency privacy architecture], T::Array[String])
42+
POSIBLE_TYPES = T.let(%w[dependency privacy layer], T::Array[String])
4343
desc 'list_top_violations type [ packs/your_pack ]', 'List the top violations of a specific type for packs/your_pack.'
4444
long_desc <<~LONG_DESC
4545
Possible types are: #{POSIBLE_TYPES.join(', ')}.
@@ -48,7 +48,7 @@ def add_dependency(from_pack, to_pack)
4848
4949
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.
5050
51-
Want to focus on the big picture first? You can use this command to list the top architecture violations.
51+
Want to focus on the big picture first? You can use this command to list the top layer violations.
5252
5353
If no pack name is passed in, this will list out violations across all packs.
5454
LONG_DESC
@@ -131,7 +131,7 @@ def update
131131
desc 'get_info [ packs/my_pack packs/my_other_pack ]', 'Get info about size and violations for packs'
132132
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)"
133133
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,architecture)'
134+
option :types, type: :string, default: 'privacy,dependency', aliases: :t, banner: 'List of validation types to include (privacy,dependency,layer)'
135135
sig { params(pack_names: String).void }
136136
def get_info(*pack_names)
137137
selected_types = options[:types].to_s.downcase.split(',')

lib/packs/private.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def self.replace_in_file(file:, find:, replace_with:)
4949
pack_name: String,
5050
enforce_dependencies: T.nilable(T::Boolean),
5151
enforce_privacy: T::Boolean,
52-
enforce_architecture: T::Boolean,
52+
enforce_layers: T::Boolean,
5353
team: T.nilable(CodeTeams::Team)
5454
).void
5555
end
56-
def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_architecture:, team:)
56+
def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team:)
5757
Logging.section('👋 Hi!') do
5858
intro = Packs.config.user_event_logger.before_create_pack(pack_name)
5959
Logging.print_bold_green(intro)
@@ -65,7 +65,7 @@ def self.create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enfor
6565
pack_name: pack_name,
6666
enforce_dependencies: enforce_dependencies,
6767
enforce_privacy: enforce_privacy,
68-
enforce_architecture: enforce_architecture,
68+
enforce_layers: enforce_layers,
6969
team: team
7070
)
7171
add_public_directory(package) if package.enforce_privacy
@@ -169,7 +169,7 @@ def self.move_to_folder!(pack_name:, destination:, per_file_processors: [Packs::
169169
name: new_package_name,
170170
enforce_dependencies: package.enforce_dependencies,
171171
enforce_privacy: package.enforce_privacy,
172-
enforce_architecture: package.enforce_architecture,
172+
enforce_layers: package.enforce_layers,
173173
dependencies: package.dependencies,
174174
violations: package.violations,
175175
metadata: package.metadata,
@@ -206,7 +206,7 @@ def self.move_to_folder!(pack_name:, destination:, per_file_processors: [Packs::
206206
name: other_package.name,
207207
enforce_dependencies: other_package.enforce_dependencies,
208208
enforce_privacy: other_package.enforce_privacy,
209-
enforce_architecture: other_package.enforce_architecture,
209+
enforce_layers: other_package.enforce_layers,
210210
dependencies: new_dependencies.uniq.sort,
211211
violations: other_package.violations,
212212
metadata: other_package.metadata,
@@ -251,7 +251,7 @@ def self.move_to_parent!(
251251
pack_name: parent_name,
252252
enforce_dependencies: true,
253253
enforce_privacy: true,
254-
enforce_architecture: true
254+
enforce_layers: true
255255
)
256256
end
257257

@@ -263,7 +263,7 @@ def self.move_to_parent!(
263263
name: new_package_name,
264264
enforce_privacy: package.enforce_privacy,
265265
enforce_dependencies: package.enforce_dependencies,
266-
enforce_architecture: package.enforce_architecture,
266+
enforce_layers: package.enforce_layers,
267267
dependencies: package.dependencies,
268268
violations: package.violations,
269269
metadata: package.metadata,
@@ -306,7 +306,7 @@ def self.move_to_parent!(
306306
name: other_package.name,
307307
enforce_dependencies: other_package.enforce_dependencies,
308308
enforce_privacy: other_package.enforce_privacy,
309-
enforce_architecture: other_package.enforce_architecture,
309+
enforce_layers: other_package.enforce_layers,
310310
dependencies: new_dependencies.uniq.sort,
311311
violations: other_package.violations,
312312
metadata: other_package.metadata,
@@ -398,7 +398,7 @@ def self.add_dependency!(pack_name:, dependency_name:)
398398
name: pack_name,
399399
dependencies: (package.dependencies + [dependency_name]).uniq.sort,
400400
enforce_privacy: package.enforce_privacy,
401-
enforce_architecture: package.enforce_architecture,
401+
enforce_layers: package.enforce_layers,
402402
enforce_dependencies: package.enforce_dependencies,
403403
violations: package.violations,
404404
metadata: package.metadata,
@@ -466,11 +466,11 @@ def self.add_readme_todo(package)
466466
pack_name: String,
467467
enforce_dependencies: T.nilable(T::Boolean),
468468
enforce_privacy: T::Boolean,
469-
enforce_architecture: T::Boolean,
469+
enforce_layers: T::Boolean,
470470
team: T.nilable(CodeTeams::Team)
471471
).returns(ParsePackwerk::Package)
472472
end
473-
def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_architecture:, team: nil)
473+
def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team: nil)
474474
allowed_locations = Packs::Specification.config.pack_paths
475475
if allowed_locations.none? { |location| File.fnmatch(location, pack_name) }
476476
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 @@ def self.create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_p
493493
package = ParsePackwerk::Package.new(
494494
enforce_dependencies: should_enforce_dependencies || false,
495495
enforce_privacy: enforce_privacy,
496-
enforce_architecture: enforce_architecture,
496+
enforce_layers: enforce_layers,
497497
dependencies: [],
498498
violations: [],
499499
metadata: {},
@@ -600,7 +600,7 @@ def self.packwerk_package_to_pack(package)
600600
include_date: T::Boolean
601601
).void
602602
end
603-
def self.get_info(packs: Packs.all, format: :detail, types: %i[privacy dependency architecture], include_date: false)
603+
def self.get_info(packs: Packs.all, format: :detail, types: %i[privacy dependency layer], include_date: false)
604604
require 'csv' if format == :csv
605605

606606
today = Date.today.iso8601

lib/packs/private/interactive_cli/use_cases/get_info.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def perform!(prompt)
3030

3131
types = prompt.multi_select(
3232
'What violation types do you want stats for?',
33-
%w[Privacy Dependency Architecture]
33+
%w[Privacy Dependency Layer]
3434
)
3535

3636
include_date = !prompt.no?('Should the current date be included in the report?')

lib/packs/private/interactive_cli/use_cases/query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def perform!(prompt)
3030

3131
limit = prompt.ask('Specify the limit of constants to analyze', default: 10, convert: :integer)
3232

33-
selection = prompt.select('Are you interested in dependency, or privacy violations?', %w[Dependency Privacy Architecture], default: 'Privacy')
33+
selection = prompt.select('Are you interested in dependency, privacy, or layer violations?', %w[Dependency Privacy Layer], default: 'Privacy')
3434

3535
Packs.list_top_violations(
3636
type: selection.downcase,

packs.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = 'packs'
3-
spec.version = '0.0.42'
3+
spec.version = '0.0.43'
44
spec.authors = ['Gusto Engineers']
55
spec.email = ['dev@gusto.com']
66

@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
3232
spec.add_dependency 'code_ownership', '>= 1.33.0'
3333
spec.add_dependency 'packs-specification'
3434
spec.add_dependency 'packwerk'
35-
spec.add_dependency 'parse_packwerk', '>= 0.22.0', '<= 0.23.0'
35+
spec.add_dependency 'parse_packwerk', '>= 0.25.0'
3636
spec.add_dependency 'rainbow'
3737
spec.add_dependency 'sorbet-runtime'
3838
spec.add_dependency 'thor'

sorbet/rbi/gems/packs-specification@0.0.10.rbi

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)