parse_packwerk 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64542153d7eb3eb07ddd1328a7c312028485b962980122465b370a38407b6e60
4
- data.tar.gz: b65eb3d71a0a1d1132cb53e4544bad7cfb62849655a9aa4e3d3b7914af1a1c85
3
+ metadata.gz: 307906041051ec00eb3cc2647b0e04be2ac81d03f4ee0ebce51450b42a6eca55
4
+ data.tar.gz: 886374546d1cbb7d8562850d541c7fd77c3089f935138ab399c3c5df632ab396
5
5
  SHA512:
6
- metadata.gz: e25be516533a00d4b2d673b1bede6ca828caa2088239fa40267649790bb92eda13865df8fae1d8146176684fb02625ae682e85d5c728bc29b5262b1d7fd44237
7
- data.tar.gz: fc59491a8e19d6470a144d6d8c29f7c379d3a127f3578c01b6d49b23ff0635968315f1cfa976c593f3d6e0dbe96c36addf089b5b85bb28fe6b65e171f1069895
6
+ metadata.gz: 76eff55192a47f33bf95cf267ed7517d143bec88ef403a36fc88b896254ef7278bfc4cc5d7a279aaa39f82d028b6db2d8ac64ee6840080c6da7cc39f5d1ce81d
7
+ data.tar.gz: 97ae51ba0bb3694e382f367deecf65ecda486679412c80c970fae1560de8253f30fcbe4eb30502cd2438e75d3cf9224a4ac4637ea91e38a2b0d2afef2d5021fd
data/README.md CHANGED
@@ -10,15 +10,15 @@ packages = ParsePackwerk.all
10
10
  # Get a single package with a given ame
11
11
  package = ParsePackwerk.find('packs/my_pack')
12
12
 
13
- # Get a structured `deprecated_references.yml` object a single package
14
- deprecated_references = ParsePackwerk::DeprecatedReferences.for(package)
13
+ # Get a structured `package_todo.yml` object a single package
14
+ package_todo = ParsePackwerk::PackageTodo.for(package)
15
15
 
16
16
  # Count violations of a particular type for a package
17
- deprecated_references.violations.count(&:privacy?)
18
- deprecated_references.violations.count(&:dependency?)
17
+ package_todo.violations.count(&:privacy?)
18
+ package_todo.violations.count(&:dependency?)
19
19
 
20
20
  # Get the number of files a particular constant is violated in
21
- deprecated_references.violations.select { |v| v.class_name == 'SomeConstant' }.sum { |v| v.files.count }
21
+ package_todo.violations.select { |v| v.class_name == 'SomeConstant' }.sum { |v| v.files.count }
22
22
  ```
23
23
 
24
24
  # Why does this gem exist?
@@ -4,7 +4,7 @@ module ParsePackwerk
4
4
  ROOT_PACKAGE_NAME = T.let('.'.freeze, String)
5
5
  PACKAGE_YML_NAME = T.let('package.yml'.freeze, String)
6
6
  PACKWERK_YML_NAME = T.let('packwerk.yml'.freeze, String)
7
- DEPRECATED_REFERENCES_YML_NAME = T.let('deprecated_references.yml'.freeze, String)
7
+ PACKAGE_TODO_YML_NAME = T.let('package_todo.yml'.freeze, String)
8
8
  ENFORCE_DEPENDENCIES = T.let('enforce_dependencies'.freeze, String)
9
9
  ENFORCE_PRIVACY = T.let('enforce_privacy'.freeze, String)
10
10
  PUBLIC_PATH = T.let('public_path'.freeze, String)
@@ -53,7 +53,7 @@ module ParsePackwerk
53
53
 
54
54
  sig { returns(T::Array[Violation]) }
55
55
  def violations
56
- DeprecatedReferences.for(self).violations
56
+ PackageTodo.for(self).violations
57
57
  end
58
58
  end
59
59
  end
@@ -1,19 +1,19 @@
1
1
  # typed: strict
2
2
 
3
3
  module ParsePackwerk
4
- class DeprecatedReferences < T::Struct
4
+ class PackageTodo < T::Struct
5
5
  extend T::Sig
6
6
 
7
7
  const :pathname, Pathname
8
8
  const :violations, T::Array[Violation]
9
9
 
10
- sig { params(package: Package).returns(DeprecatedReferences) }
10
+ sig { params(package: Package).returns(PackageTodo) }
11
11
  def self.for(package)
12
- deprecated_references_yml_pathname = package.directory.join(DEPRECATED_REFERENCES_YML_NAME)
13
- DeprecatedReferences.from(deprecated_references_yml_pathname)
12
+ package_todo_yml_pathname = package.directory.join(PACKAGE_TODO_YML_NAME)
13
+ PackageTodo.from(package_todo_yml_pathname)
14
14
  end
15
15
 
16
- sig { params(pathname: Pathname).returns(DeprecatedReferences) }
16
+ sig { params(pathname: Pathname).returns(PackageTodo) }
17
17
  def self.from(pathname)
18
18
  if !pathname.exist?
19
19
  new(
@@ -21,13 +21,13 @@ module ParsePackwerk
21
21
  violations: []
22
22
  )
23
23
  else
24
- deprecated_references_loaded_yml = YAML.load_file(pathname)
24
+ package_todo_loaded_yml = YAML.load_file(pathname)
25
25
 
26
26
  all_violations = []
27
- deprecated_references_loaded_yml&.each_key do |to_package_name|
28
- deprecated_references_per_package = deprecated_references_loaded_yml[to_package_name]
29
- deprecated_references_per_package.each_key do |class_name|
30
- symbol_usage = deprecated_references_per_package[class_name]
27
+ package_todo_loaded_yml&.each_key do |to_package_name|
28
+ package_todo_per_package = package_todo_loaded_yml[to_package_name]
29
+ package_todo_per_package.each_key do |class_name|
30
+ symbol_usage = package_todo_per_package[class_name]
31
31
  files = symbol_usage['files']
32
32
  violations = symbol_usage['violations']
33
33
  if violations.include? 'dependency'
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  require 'pathname'
6
6
  require 'parse_packwerk/constants'
7
7
  require 'parse_packwerk/violation'
8
- require 'parse_packwerk/deprecated_references'
8
+ require 'parse_packwerk/package_todo'
9
9
  require 'parse_packwerk/package'
10
10
  require 'parse_packwerk/configuration'
11
11
  require 'parse_packwerk/package_set'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parse_packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -133,9 +133,9 @@ files:
133
133
  - lib/parse_packwerk.rb
134
134
  - lib/parse_packwerk/configuration.rb
135
135
  - lib/parse_packwerk/constants.rb
136
- - lib/parse_packwerk/deprecated_references.rb
137
136
  - lib/parse_packwerk/package.rb
138
137
  - lib/parse_packwerk/package_set.rb
138
+ - lib/parse_packwerk/package_todo.rb
139
139
  - lib/parse_packwerk/violation.rb
140
140
  - sorbet/config
141
141
  - sorbet/rbi/gems/hashdiff@1.0.1.rbi