packwerk 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -7
  3. data/README.md +2 -1
  4. data/TROUBLESHOOT.md +3 -3
  5. data/USAGE.md +27 -11
  6. data/exe/packwerk +7 -1
  7. data/lib/packwerk/application_load_paths.rb +1 -0
  8. data/lib/packwerk/application_validator.rb +3 -1
  9. data/lib/packwerk/cli.rb +27 -5
  10. data/lib/packwerk/const_node_inspector.rb +3 -2
  11. data/lib/packwerk/constant_name_inspector.rb +1 -1
  12. data/lib/packwerk/deprecated_references.rb +11 -6
  13. data/lib/packwerk/file_processor.rb +39 -14
  14. data/lib/packwerk/files_for_processing.rb +15 -4
  15. data/lib/packwerk/generators/templates/package.yml +1 -1
  16. data/lib/packwerk/graph.rb +2 -0
  17. data/lib/packwerk/inflector.rb +1 -0
  18. data/lib/packwerk/node.rb +1 -0
  19. data/lib/packwerk/node_processor.rb +10 -22
  20. data/lib/packwerk/node_processor_factory.rb +0 -2
  21. data/lib/packwerk/node_visitor.rb +4 -2
  22. data/lib/packwerk/package.rb +25 -4
  23. data/lib/packwerk/package_set.rb +43 -8
  24. data/lib/packwerk/parsed_constant_definitions.rb +1 -0
  25. data/lib/packwerk/reference.rb +2 -1
  26. data/lib/packwerk/reference_checking/checkers/checker.rb +21 -0
  27. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +31 -0
  28. data/lib/packwerk/reference_checking/checkers/privacy_checker.rb +58 -0
  29. data/lib/packwerk/reference_checking/reference_checker.rb +33 -0
  30. data/lib/packwerk/reference_extractor.rb +2 -2
  31. data/lib/packwerk/reference_offense.rb +1 -0
  32. data/lib/packwerk/run_context.rb +9 -6
  33. data/lib/packwerk/sanity_checker.rb +1 -1
  34. data/lib/packwerk/spring_command.rb +28 -0
  35. data/lib/packwerk/version.rb +1 -1
  36. data/lib/packwerk/violation_type.rb +1 -1
  37. data/lib/packwerk.rb +14 -3
  38. data/packwerk.gemspec +3 -1
  39. data/service.yml +0 -2
  40. data/sorbet/rbi/gems/psych@3.3.2.rbi +24 -0
  41. metadata +23 -6
  42. data/lib/packwerk/checker.rb +0 -17
  43. data/lib/packwerk/dependency_checker.rb +0 -26
  44. data/lib/packwerk/privacy_checker.rb +0 -53
@@ -1,38 +1,52 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
+ # The basic unit of modularity for packwerk; a folder that has been declared to define a package.
6
+ # The package contains all constants defined in files in this folder and all subfolders that are not packages
7
+ # themselves.
5
8
  class Package
9
+ extend T::Sig
6
10
  include Comparable
7
11
 
8
12
  ROOT_PACKAGE_NAME = "."
9
13
 
10
- attr_reader :name, :dependencies
14
+ sig { returns(String) }
15
+ attr_reader :name
16
+ sig { returns(T::Array[String]) }
17
+ attr_reader :dependencies
11
18
 
19
+ sig { params(name: String, config: T.nilable(T.any(T::Hash[T.untyped, T.untyped], FalseClass))).void }
12
20
  def initialize(name:, config:)
13
21
  @name = name
14
- @config = config || {}
15
- @dependencies = Array(@config["dependencies"]).freeze
22
+ @config = T.let(config || {}, T::Hash[T.untyped, T.untyped])
23
+ @dependencies = T.let(Array(@config["dependencies"]).freeze, T::Array[String])
16
24
  end
17
25
 
26
+ sig { returns(T.nilable(T.any(T::Boolean, T::Array[String]))) }
18
27
  def enforce_privacy
19
28
  @config["enforce_privacy"]
20
29
  end
21
30
 
31
+ sig { returns(T::Boolean) }
22
32
  def enforce_dependencies?
23
33
  @config["enforce_dependencies"] == true
24
34
  end
25
35
 
36
+ sig { params(package: Package).returns(T::Boolean) }
26
37
  def dependency?(package)
27
38
  @dependencies.include?(package.name)
28
39
  end
29
40
 
41
+ sig { params(path: String).returns(T::Boolean) }
30
42
  def package_path?(path)
31
43
  return true if root?
32
44
  path.start_with?(@name)
33
45
  end
34
46
 
47
+ sig { returns(String) }
35
48
  def public_path
49
+ @public_path = T.let(@public_path, T.nilable(String))
36
50
  @public_path ||= begin
37
51
  unprefixed_public_path = user_defined_public_path || "app/public/"
38
52
 
@@ -44,10 +58,12 @@ module Packwerk
44
58
  end
45
59
  end
46
60
 
61
+ sig { params(path: String).returns(T::Boolean) }
47
62
  def public_path?(path)
48
63
  path.start_with?(public_path)
49
64
  end
50
65
 
66
+ sig { returns(T.nilable(String)) }
51
67
  def user_defined_public_path
52
68
  return unless @config["public_path"]
53
69
  return @config["public_path"] if @config["public_path"].end_with?("/")
@@ -55,23 +71,28 @@ module Packwerk
55
71
  @config["public_path"] + "/"
56
72
  end
57
73
 
74
+ sig { params(other: T.untyped).returns(T.nilable(Integer)) }
58
75
  def <=>(other)
59
76
  return nil unless other.is_a?(self.class)
60
77
  name <=> other.name
61
78
  end
62
79
 
80
+ sig { params(other: T.untyped).returns(T::Boolean) }
63
81
  def eql?(other)
64
82
  self == other
65
83
  end
66
84
 
85
+ sig { returns(Integer) }
67
86
  def hash
68
87
  name.hash
69
88
  end
70
89
 
90
+ sig { returns(String) }
71
91
  def to_s
72
92
  name
73
93
  end
74
94
 
95
+ sig { returns(T::Boolean) }
75
96
  def root?
76
97
  @name == ROOT_PACKAGE_NAME
77
98
  end
@@ -1,15 +1,25 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "pathname"
5
5
 
6
6
  module Packwerk
7
+ PathSpec = T.type_alias { T.any(String, T::Array[String]) }
8
+
9
+ # A set of {Packwerk::Package}s as well as methods to parse packages from the filesystem.
7
10
  class PackageSet
11
+ extend T::Sig
12
+ extend T::Generic
8
13
  include Enumerable
9
14
 
15
+ Elem = type_member(fixed: Package)
16
+
10
17
  PACKAGE_CONFIG_FILENAME = "package.yml"
11
18
 
12
19
  class << self
20
+ extend T::Sig
21
+
22
+ sig { params(root_path: String, package_pathspec: T.nilable(PathSpec)).returns(PackageSet) }
13
23
  def load_all_from(root_path, package_pathspec: nil)
14
24
  package_paths = package_paths(root_path, package_pathspec || "**")
15
25
 
@@ -23,8 +33,17 @@ module Packwerk
23
33
  new(packages)
24
34
  end
25
35
 
26
- def package_paths(root_path, package_pathspec)
27
- bundle_path_match = Bundler.bundle_path.join("**").to_s
36
+ sig do
37
+ params(
38
+ root_path: String,
39
+ package_pathspec: PathSpec,
40
+ exclude_pathspec: T.nilable(PathSpec)
41
+ ).returns(T::Array[Pathname])
42
+ end
43
+ def package_paths(root_path, package_pathspec, exclude_pathspec = [])
44
+ exclude_pathspec = Array(exclude_pathspec).dup
45
+ .push(Bundler.bundle_path.join("**").to_s)
46
+ .map { |glob| File.expand_path(glob) }
28
47
 
29
48
  glob_patterns = Array(package_pathspec).map do |pathspec|
30
49
  File.join(root_path, pathspec, PACKAGE_CONFIG_FILENAME)
@@ -32,34 +51,50 @@ module Packwerk
32
51
 
33
52
  Dir.glob(glob_patterns)
34
53
  .map { |path| Pathname.new(path).cleanpath }
35
- .reject { |path| path.realpath.fnmatch(bundle_path_match) }
54
+ .reject { |path| exclude_path?(exclude_pathspec, path) }
36
55
  end
37
56
 
38
57
  private
39
58
 
59
+ sig { params(packages: T::Array[Package]).void }
40
60
  def create_root_package_if_none_in(packages)
41
61
  return if packages.any?(&:root?)
42
62
  packages << Package.new(name: Package::ROOT_PACKAGE_NAME, config: nil)
43
63
  end
64
+
65
+ sig { params(globs: T::Array[String], path: Pathname).returns(T::Boolean) }
66
+ def exclude_path?(globs, path)
67
+ globs.any? do |glob|
68
+ path.realpath.fnmatch(glob, File::FNM_EXTGLOB)
69
+ end
70
+ end
44
71
  end
45
72
 
73
+ sig { returns(T::Hash[String, Package]) }
74
+ attr_reader :packages
75
+
76
+ sig { params(packages: T::Array[Package]).void }
46
77
  def initialize(packages)
47
78
  # We want to match more specific paths first
48
79
  sorted_packages = packages.sort_by { |package| -package.name.length }
49
- @packages = sorted_packages.each_with_object({}) { |package, hash| hash[package.name] = package }
80
+ packages = sorted_packages.each_with_object({}) { |package, hash| hash[package.name] = package }
81
+ @packages = T.let(packages, T::Hash[String, Package])
50
82
  end
51
83
 
84
+ sig { override.params(blk: T.proc.params(arg0: Package).returns(T.untyped)).returns(T.untyped) }
52
85
  def each(&blk)
53
- @packages.values.each(&blk)
86
+ packages.values.each(&blk)
54
87
  end
55
88
 
89
+ sig { params(name: String).returns(T.nilable(Package)) }
56
90
  def fetch(name)
57
- @packages[name]
91
+ packages[name]
58
92
  end
59
93
 
94
+ sig { params(file_path: T.any(Pathname, String)).returns(T.nilable(Package)) }
60
95
  def package_from_path(file_path)
61
96
  path_string = file_path.to_s
62
- @packages.values.find { |package| package.package_path?(path_string) }
97
+ packages.values.find { |package| package.package_path?(path_string) }
63
98
  end
64
99
  end
65
100
  end
@@ -4,6 +4,7 @@
4
4
  require "ast/node"
5
5
 
6
6
  module Packwerk
7
+ # A collection of constant definitions parsed from an Abstract Syntax Tree (AST).
7
8
  class ParsedConstantDefinitions
8
9
  def initialize(root_node:)
9
10
  @local_definitions = {}
@@ -2,5 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
- Reference = Struct.new(:source_package, :relative_path, :constant)
5
+ # A reference from a file in one package to a constant that may be defined in a different package.
6
+ Reference = Struct.new(:source_package, :relative_path, :constant, :source_location)
6
7
  end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ module ReferenceChecking
6
+ module Checkers
7
+ module Checker
8
+ extend T::Sig
9
+ extend T::Helpers
10
+
11
+ interface!
12
+
13
+ sig { returns(ViolationType).abstract }
14
+ def violation_type; end
15
+
16
+ sig { params(reference: Reference).returns(T::Boolean).abstract }
17
+ def invalid_reference?(reference); end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,31 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ module ReferenceChecking
6
+ module Checkers
7
+ # Checks whether a given reference conforms to the configured graph of dependencies.
8
+ class DependencyChecker
9
+ extend T::Sig
10
+ include Checker
11
+
12
+ sig { override.returns(ViolationType) }
13
+ def violation_type
14
+ ViolationType::Dependency
15
+ end
16
+
17
+ sig do
18
+ override
19
+ .params(reference: Packwerk::Reference)
20
+ .returns(T::Boolean)
21
+ end
22
+ def invalid_reference?(reference)
23
+ return false unless reference.source_package
24
+ return false unless reference.source_package.enforce_dependencies?
25
+ return false if reference.source_package.dependency?(reference.constant.package)
26
+ true
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ module ReferenceChecking
6
+ module Checkers
7
+ # Checks whether a given reference references a private constant of another package.
8
+ class PrivacyChecker
9
+ extend T::Sig
10
+ include Checker
11
+
12
+ sig { override.returns(Packwerk::ViolationType) }
13
+ def violation_type
14
+ ViolationType::Privacy
15
+ end
16
+
17
+ sig do
18
+ override
19
+ .params(reference: Packwerk::Reference)
20
+ .returns(T::Boolean)
21
+ end
22
+ def invalid_reference?(reference)
23
+ return false if reference.constant.public?
24
+
25
+ privacy_option = reference.constant.package.enforce_privacy
26
+ return false if enforcement_disabled?(privacy_option)
27
+
28
+ return false unless privacy_option == true ||
29
+ explicitly_private_constant?(reference.constant, explicitly_private_constants: privacy_option)
30
+
31
+ true
32
+ end
33
+
34
+ private
35
+
36
+ sig do
37
+ params(
38
+ constant: ConstantDiscovery::ConstantContext,
39
+ explicitly_private_constants: T::Array[String]
40
+ ).returns(T::Boolean)
41
+ end
42
+ def explicitly_private_constant?(constant, explicitly_private_constants:)
43
+ explicitly_private_constants.include?(constant.name) ||
44
+ # nested constants
45
+ explicitly_private_constants.any? { |epc| constant.name.start_with?(epc + "::") }
46
+ end
47
+
48
+ sig do
49
+ params(privacy_option: T.nilable(T.any(T::Boolean, T::Array[String])))
50
+ .returns(T::Boolean)
51
+ end
52
+ def enforcement_disabled?(privacy_option)
53
+ [false, nil].include?(privacy_option)
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,33 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ module ReferenceChecking
6
+ class ReferenceChecker
7
+ extend T::Sig
8
+
9
+ def initialize(checkers)
10
+ @checkers = checkers
11
+ end
12
+
13
+ sig do
14
+ params(
15
+ reference: T.any(Packwerk::Reference, Packwerk::Offense)
16
+ ).returns(T::Array[Packwerk::Offense])
17
+ end
18
+ def call(reference)
19
+ return [reference] if reference.is_a?(Packwerk::Offense)
20
+
21
+ @checkers.each_with_object([]) do |checker, violations|
22
+ next unless checker.invalid_reference?(reference)
23
+ offense = Packwerk::ReferenceOffense.new(
24
+ location: reference.source_location,
25
+ reference: reference,
26
+ violation_type: checker.violation_type
27
+ )
28
+ violations << offense
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
- # extracts a possible constant reference from a given AST node
5
+ # Extracts a possible constant reference from a given AST node.
6
6
  class ReferenceExtractor
7
7
  extend T::Sig
8
8
 
@@ -59,7 +59,7 @@ module Packwerk
59
59
 
60
60
  return if source_package == constant.package
61
61
 
62
- Reference.new(source_package, relative_path, constant)
62
+ Reference.new(source_package, relative_path, constant, Node.location(node))
63
63
  end
64
64
 
65
65
  def local_reference?(constant_name, name_location, namespace_path)
@@ -2,6 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
+ # An offense related to a {Packwerk::Reference}.
5
6
  class ReferenceOffense < Offense
6
7
  extend T::Sig
7
8
  extend T::Helpers
@@ -4,6 +4,7 @@
4
4
  require "constant_resolver"
5
5
 
6
6
  module Packwerk
7
+ # Holds the context of a Packwerk run across multiple files.
7
8
  class RunContext
8
9
  extend T::Sig
9
10
 
@@ -17,8 +18,8 @@ module Packwerk
17
18
  )
18
19
 
19
20
  DEFAULT_CHECKERS = [
20
- ::Packwerk::DependencyChecker,
21
- ::Packwerk::PrivacyChecker,
21
+ ::Packwerk::ReferenceChecking::Checkers::DependencyChecker,
22
+ ::Packwerk::ReferenceChecking::Checkers::PrivacyChecker,
22
23
  ]
23
24
 
24
25
  class << self
@@ -50,9 +51,12 @@ module Packwerk
50
51
  @checker_classes = checker_classes
51
52
  end
52
53
 
53
- sig { params(file: String).returns(T::Array[T.nilable(::Packwerk::Offense)]) }
54
+ sig { params(file: String).returns(T::Array[Packwerk::Offense]) }
54
55
  def process_file(file:)
55
- file_processor.call(file)
56
+ references = file_processor.call(file)
57
+
58
+ reference_checker = ReferenceChecking::ReferenceChecker.new(checkers)
59
+ references.flat_map { |reference| reference_checker.call(reference) }
56
60
  end
57
61
 
58
62
  private
@@ -66,7 +70,6 @@ module Packwerk
66
70
  def node_processor_factory
67
71
  NodeProcessorFactory.new(
68
72
  context_provider: context_provider,
69
- checkers: checkers,
70
73
  root_path: root_path,
71
74
  constant_name_inspectors: constant_name_inspectors
72
75
  )
@@ -94,7 +97,7 @@ module Packwerk
94
97
  ::Packwerk::PackageSet.load_all_from(root_path, package_pathspec: package_paths)
95
98
  end
96
99
 
97
- sig { returns(T::Array[Checker]) }
100
+ sig { returns(T::Array[ReferenceChecking::Checkers::Checker]) }
98
101
  def checkers
99
102
  checker_classes.map(&:new)
100
103
  end
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ # typed: false
3
+
4
+ require "spring/commands"
5
+
6
+ module Packwerk
7
+ class SpringCommand
8
+ def env(*)
9
+ # Packwerk needs to run in a test environment, which has a set of autoload paths that are
10
+ # often a superset of the dev/prod paths (for example, test/support/helpers)
11
+ "test"
12
+ end
13
+
14
+ def exec_name
15
+ "packwerk"
16
+ end
17
+
18
+ def gem_name
19
+ "packwerk"
20
+ end
21
+
22
+ def call
23
+ load(Gem.bin_path(gem_name, exec_name))
24
+ end
25
+ end
26
+
27
+ Spring.register_command("packwerk", SpringCommand.new)
28
+ end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
- VERSION = "1.3.2"
5
+ VERSION = "1.4.0"
6
6
  end
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
data/lib/packwerk.rb CHANGED
@@ -12,13 +12,11 @@ module Packwerk
12
12
  autoload :ApplicationValidator
13
13
  autoload :AssociationInspector
14
14
  autoload :OffenseCollection
15
- autoload :Checker
16
15
  autoload :Cli
17
16
  autoload :Configuration
18
17
  autoload :ConstantDiscovery
19
18
  autoload :ConstantNameInspector
20
19
  autoload :ConstNodeInspector
21
- autoload :DependencyChecker
22
20
  autoload :DeprecatedReferences
23
21
  autoload :FileProcessor
24
22
  autoload :FilesForProcessing
@@ -36,7 +34,6 @@ module Packwerk
36
34
  autoload :ParsedConstantDefinitions
37
35
  autoload :Parsers
38
36
  autoload :ParseRun
39
- autoload :PrivacyChecker
40
37
  autoload :Reference
41
38
  autoload :ReferenceExtractor
42
39
  autoload :ReferenceOffense
@@ -77,4 +74,18 @@ module Packwerk
77
74
  autoload :InflectionsFile
78
75
  autoload :RootPackage
79
76
  end
77
+
78
+ module ReferenceChecking
79
+ extend ActiveSupport::Autoload
80
+
81
+ autoload :ReferenceChecker
82
+
83
+ module Checkers
84
+ extend ActiveSupport::Autoload
85
+
86
+ autoload :Checker
87
+ autoload :DependencyChecker
88
+ autoload :PrivacyChecker
89
+ end
90
+ end
80
91
  end
data/packwerk.gemspec CHANGED
@@ -44,11 +44,13 @@ Gem::Specification.new do |spec|
44
44
  spec.add_dependency("constant_resolver")
45
45
  spec.add_dependency("parallel")
46
46
  spec.add_dependency("sorbet-runtime")
47
+ spec.add_dependency("bundler")
47
48
 
48
- spec.add_development_dependency("bundler")
49
49
  spec.add_development_dependency("rake")
50
50
  spec.add_development_dependency("sorbet")
51
51
  spec.add_development_dependency("m")
52
+ # https://github.com/ruby/psych/pull/487
53
+ spec.add_development_dependency("psych", "~> 3")
52
54
 
53
55
  # For Ruby parsing
54
56
  spec.add_dependency("ast")
data/service.yml CHANGED
@@ -1,3 +1 @@
1
1
  classification: library
2
- slack_channels:
3
- - core-stewardship
@@ -0,0 +1,24 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `psych` gem.
5
+ # Please instead update this file by running `bin/tapioca gem psych`.
6
+
7
+ ::RUBY19 = T.let(T.unsafe(nil), TrueClass)
8
+
9
+ class Object < ::BasicObject
10
+ include ::ActiveSupport::ToJsonWithActiveSupportEncoder
11
+ include ::Kernel
12
+ include ::JSON::Ext::Generator::GeneratorMethods::Object
13
+ include ::ActiveSupport::Tryable
14
+ include ::Minitest::Expectations
15
+ include ::Mocha::ParameterMatchers::InstanceMethods
16
+ include ::Mocha::Inspect::ObjectMethods
17
+ include ::Mocha::ObjectMethods
18
+
19
+ def to_yaml(options = T.unsafe(nil)); end
20
+
21
+ class << self
22
+ def yaml_tag(url); end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -73,7 +73,7 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
- type: :development
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: psych
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: ast
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -206,13 +220,11 @@ files:
206
220
  - lib/packwerk/application_load_paths.rb
207
221
  - lib/packwerk/application_validator.rb
208
222
  - lib/packwerk/association_inspector.rb
209
- - lib/packwerk/checker.rb
210
223
  - lib/packwerk/cli.rb
211
224
  - lib/packwerk/configuration.rb
212
225
  - lib/packwerk/const_node_inspector.rb
213
226
  - lib/packwerk/constant_discovery.rb
214
227
  - lib/packwerk/constant_name_inspector.rb
215
- - lib/packwerk/dependency_checker.rb
216
228
  - lib/packwerk/deprecated_references.rb
217
229
  - lib/packwerk/file_processor.rb
218
230
  - lib/packwerk/files_for_processing.rb
@@ -246,13 +258,17 @@ files:
246
258
  - lib/packwerk/parsers/erb.rb
247
259
  - lib/packwerk/parsers/factory.rb
248
260
  - lib/packwerk/parsers/ruby.rb
249
- - lib/packwerk/privacy_checker.rb
250
261
  - lib/packwerk/reference.rb
262
+ - lib/packwerk/reference_checking/checkers/checker.rb
263
+ - lib/packwerk/reference_checking/checkers/dependency_checker.rb
264
+ - lib/packwerk/reference_checking/checkers/privacy_checker.rb
265
+ - lib/packwerk/reference_checking/reference_checker.rb
251
266
  - lib/packwerk/reference_extractor.rb
252
267
  - lib/packwerk/reference_offense.rb
253
268
  - lib/packwerk/result.rb
254
269
  - lib/packwerk/run_context.rb
255
270
  - lib/packwerk/sanity_checker.rb
271
+ - lib/packwerk/spring_command.rb
256
272
  - lib/packwerk/version.rb
257
273
  - lib/packwerk/violation_type.rb
258
274
  - library.yml
@@ -301,6 +317,7 @@ files:
301
317
  - sorbet/rbi/gems/parlour@6.0.0.rbi
302
318
  - sorbet/rbi/gems/parser@3.0.0.0.rbi
303
319
  - sorbet/rbi/gems/pry@0.14.0.rbi
320
+ - sorbet/rbi/gems/psych@3.3.2.rbi
304
321
  - sorbet/rbi/gems/racc@1.5.2.rbi
305
322
  - sorbet/rbi/gems/rack-test@1.1.0.rbi
306
323
  - sorbet/rbi/gems/rack@2.2.3.rbi
@@ -1,17 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- module Packwerk
5
- module Checker
6
- extend T::Sig
7
- extend T::Helpers
8
-
9
- interface!
10
-
11
- sig { returns(ViolationType).abstract }
12
- def violation_type; end
13
-
14
- sig { params(reference: Reference).returns(T::Boolean).abstract }
15
- def invalid_reference?(reference); end
16
- end
17
- end