packwerk 1.1.0 → 1.3.0

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.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +17 -8
  3. data/.ruby-version +1 -1
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +129 -111
  6. data/README.md +10 -3
  7. data/TROUBLESHOOT.md +2 -2
  8. data/USAGE.md +30 -30
  9. data/bin/m +29 -0
  10. data/bin/rake +29 -0
  11. data/bin/rubocop +29 -0
  12. data/bin/srb +29 -0
  13. data/bin/tapioca +29 -0
  14. data/dev.yml +7 -7
  15. data/exe/packwerk +1 -1
  16. data/gemfiles/Gemfile-rails-6-0 +22 -0
  17. data/lib/packwerk.rb +72 -34
  18. data/lib/packwerk/application_load_paths.rb +21 -10
  19. data/lib/packwerk/application_validator.rb +104 -84
  20. data/lib/packwerk/association_inspector.rb +23 -11
  21. data/lib/packwerk/checker.rb +4 -7
  22. data/lib/packwerk/cli.rb +36 -129
  23. data/lib/packwerk/configuration.rb +10 -2
  24. data/lib/packwerk/const_node_inspector.rb +13 -14
  25. data/lib/packwerk/constant_discovery.rb +2 -0
  26. data/lib/packwerk/constant_name_inspector.rb +0 -1
  27. data/lib/packwerk/dependency_checker.rb +12 -17
  28. data/lib/packwerk/deprecated_references.rb +8 -10
  29. data/lib/packwerk/file_processor.rb +0 -4
  30. data/lib/packwerk/formatters/offenses_formatter.rb +52 -0
  31. data/lib/packwerk/formatters/progress_formatter.rb +9 -4
  32. data/lib/packwerk/generators/configuration_file.rb +0 -1
  33. data/lib/packwerk/inflector.rb +0 -2
  34. data/lib/packwerk/node.rb +9 -2
  35. data/lib/packwerk/node_processor.rb +15 -32
  36. data/lib/packwerk/node_processor_factory.rb +0 -5
  37. data/lib/packwerk/node_visitor.rb +1 -4
  38. data/lib/packwerk/offense.rb +2 -8
  39. data/lib/packwerk/offense_collection.rb +84 -0
  40. data/lib/packwerk/offenses_formatter.rb +19 -0
  41. data/lib/packwerk/output_style.rb +20 -0
  42. data/lib/packwerk/output_styles/coloured.rb +29 -0
  43. data/lib/packwerk/output_styles/plain.rb +26 -0
  44. data/lib/packwerk/package.rb +17 -1
  45. data/lib/packwerk/package_set.rb +2 -3
  46. data/lib/packwerk/parse_run.rb +106 -0
  47. data/lib/packwerk/parsed_constant_definitions.rb +2 -4
  48. data/lib/packwerk/parsers.rb +0 -2
  49. data/lib/packwerk/parsers/erb.rb +0 -2
  50. data/lib/packwerk/parsers/factory.rb +1 -3
  51. data/lib/packwerk/privacy_checker.rb +22 -17
  52. data/lib/packwerk/reference_extractor.rb +0 -8
  53. data/lib/packwerk/reference_offense.rb +49 -0
  54. data/lib/packwerk/result.rb +9 -0
  55. data/lib/packwerk/run_context.rb +4 -21
  56. data/lib/packwerk/sanity_checker.rb +1 -3
  57. data/lib/packwerk/version.rb +1 -1
  58. data/lib/packwerk/violation_type.rb +0 -2
  59. data/library.yml +1 -1
  60. data/packwerk.gemspec +1 -0
  61. data/service.yml +1 -4
  62. data/shipit.rubygems.yml +5 -1
  63. data/sorbet/rbi/gems/{actioncable@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actioncable@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +56 -36
  64. data/sorbet/rbi/gems/{actionmailbox@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionmailbox@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +25 -28
  65. data/sorbet/rbi/gems/{actionmailer@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionmailer@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +43 -24
  66. data/sorbet/rbi/gems/{actionpack@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionpack@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +382 -284
  67. data/sorbet/rbi/gems/{actiontext@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actiontext@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +76 -40
  68. data/sorbet/rbi/gems/{actionview@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionview@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +206 -195
  69. data/sorbet/rbi/gems/{activejob@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activejob@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +64 -75
  70. data/sorbet/rbi/gems/{activemodel@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activemodel@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +103 -56
  71. data/sorbet/rbi/gems/{activerecord@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activerecord@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +1250 -898
  72. data/sorbet/rbi/gems/{activestorage@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activestorage@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +92 -120
  73. data/sorbet/rbi/gems/{activesupport@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activesupport@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +292 -193
  74. data/sorbet/rbi/gems/{ast@2.4.1.rbi → ast@2.4.2.rbi} +2 -1
  75. data/sorbet/rbi/gems/{better_html@1.0.15.rbi → better_html@1.0.16.rbi} +2 -2
  76. data/sorbet/rbi/gems/{concurrent-ruby@1.1.6.rbi → concurrent-ruby@1.1.8.rbi} +12 -9
  77. data/sorbet/rbi/gems/{erubi@1.9.0.rbi → erubi@1.10.0.rbi} +3 -1
  78. data/sorbet/rbi/gems/{i18n@1.8.2.rbi → i18n@1.8.10.rbi} +19 -52
  79. data/sorbet/rbi/gems/{loofah@2.5.0.rbi → loofah@2.9.0.rbi} +3 -1
  80. data/sorbet/rbi/gems/marcel@1.0.0.rbi +70 -0
  81. data/sorbet/rbi/gems/{mini_mime@1.0.2.rbi → mini_mime@1.0.3.rbi} +6 -6
  82. data/sorbet/rbi/gems/{mini_portile2@2.4.0.rbi → minitest-focus@1.2.1.rbi} +2 -2
  83. data/sorbet/rbi/gems/{minitest@5.14.0.rbi → minitest@5.14.4.rbi} +31 -29
  84. data/sorbet/rbi/gems/{mocha@1.11.2.rbi → mocha@1.12.0.rbi} +25 -36
  85. data/sorbet/rbi/gems/{nio4r@2.5.2.rbi → nio4r@2.5.7.rbi} +21 -20
  86. data/sorbet/rbi/gems/{nokogiri@1.10.9.rbi → nokogiri@1.11.2.rbi} +193 -154
  87. data/sorbet/rbi/gems/parallel@1.20.1.rbi +117 -0
  88. data/sorbet/rbi/gems/parlour@6.0.0.rbi +1272 -0
  89. data/sorbet/rbi/gems/{parser@2.7.1.4.rbi → parser@3.0.0.0.rbi} +287 -174
  90. data/sorbet/rbi/gems/{pry@0.13.1.rbi → pry@0.14.0.rbi} +1 -1
  91. data/sorbet/rbi/gems/racc@1.5.2.rbi +57 -0
  92. data/sorbet/rbi/gems/{rack@2.2.2.rbi → rack@2.2.3.rbi} +23 -35
  93. data/sorbet/rbi/gems/{rails@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → rails@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +1 -1
  94. data/sorbet/rbi/gems/{railties@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → railties@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +132 -121
  95. data/sorbet/rbi/gems/{rake@13.0.1.rbi → rake@13.0.3.rbi} +16 -20
  96. data/sorbet/rbi/gems/{parallel@1.19.1.rbi → regexp_parser@2.1.1.rbi} +2 -2
  97. data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +8 -0
  98. data/sorbet/rbi/gems/{rubocop-performance@1.5.2.rbi → rubocop-performance@1.10.2.rbi} +1 -1
  99. data/sorbet/rbi/gems/{rubocop-shopify@1.0.2.rbi → rubocop-shopify@2.0.1.rbi} +1 -1
  100. data/sorbet/rbi/gems/{rubocop-sorbet@0.3.7.rbi → rubocop-sorbet@0.6.1.rbi} +1 -1
  101. data/sorbet/rbi/gems/{rubocop@0.82.0.rbi → rubocop@1.12.0.rbi} +1 -1
  102. data/sorbet/rbi/gems/{ruby-progressbar@1.10.1.rbi → ruby-progressbar@1.11.0.rbi} +1 -1
  103. data/sorbet/rbi/gems/spoom@1.1.0.rbi +1061 -0
  104. data/sorbet/rbi/gems/{spring@2.1.0.rbi → spring@2.1.1.rbi} +7 -7
  105. data/sorbet/rbi/gems/{sprockets-rails@3.2.1.rbi → sprockets-rails@3.2.2.rbi} +88 -68
  106. data/sorbet/rbi/gems/{sprockets@4.0.0.rbi → sprockets@4.0.2.rbi} +8 -7
  107. data/sorbet/rbi/gems/{tapioca@0.4.5.rbi → tapioca@0.4.19.rbi} +109 -24
  108. data/sorbet/rbi/gems/{thor@1.0.1.rbi → thor@1.1.0.rbi} +16 -15
  109. data/sorbet/rbi/gems/{tzinfo@2.0.2.rbi → tzinfo@2.0.4.rbi} +21 -2
  110. data/sorbet/rbi/gems/{unicode-display_width@1.7.0.rbi → unicode-display_width@2.0.0.rbi} +1 -1
  111. data/sorbet/rbi/gems/{websocket-driver@0.7.1.rbi → websocket-driver@0.7.3.rbi} +29 -29
  112. data/sorbet/rbi/gems/{websocket-extensions@0.1.4.rbi → websocket-extensions@0.1.5.rbi} +2 -2
  113. data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +177 -0
  114. data/sorbet/tapioca/require.rb +1 -0
  115. metadata +83 -65
  116. data/lib/packwerk/cache_deprecated_references.rb +0 -47
  117. data/lib/packwerk/checking_deprecated_references.rb +0 -40
  118. data/lib/packwerk/commands/detect_stale_violations_command.rb +0 -63
  119. data/lib/packwerk/commands/offense_progress_marker.rb +0 -24
  120. data/lib/packwerk/detect_stale_deprecated_references.rb +0 -14
  121. data/lib/packwerk/generators/application_validation.rb +0 -62
  122. data/lib/packwerk/generators/templates/packwerk +0 -23
  123. data/lib/packwerk/generators/templates/packwerk_validator_test.rb +0 -11
  124. data/lib/packwerk/output_styles.rb +0 -41
  125. data/lib/packwerk/reference_lister.rb +0 -23
  126. data/lib/packwerk/spring_command.rb +0 -28
  127. data/lib/packwerk/updating_deprecated_references.rb +0 -14
  128. data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +0 -8
  129. data/sorbet/rbi/gems/marcel@0.3.3.rbi +0 -30
  130. data/sorbet/rbi/gems/mimemagic@0.3.5.rbi +0 -47
  131. data/sorbet/rbi/gems/parlour@4.0.1.rbi +0 -561
  132. data/sorbet/rbi/gems/spoom@1.0.4.rbi +0 -418
  133. data/sorbet/rbi/gems/zeitwerk@2.3.0.rbi +0 -8
@@ -3,8 +3,6 @@
3
3
 
4
4
  require "singleton"
5
5
 
6
- require "packwerk/parsers"
7
-
8
6
  module Packwerk
9
7
  module Parsers
10
8
  class Factory
@@ -31,7 +29,7 @@ module Packwerk
31
29
  end
32
30
 
33
31
  def erb_parser_class
34
- @erb_parser_class || Erb
32
+ @erb_parser_class ||= Erb
35
33
  end
36
34
 
37
35
  def erb_parser_class=(klass)
@@ -1,46 +1,51 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
- require "packwerk/violation_type"
5
- require "packwerk/checker"
6
-
7
4
  module Packwerk
8
5
  class PrivacyChecker
6
+ extend T::Sig
9
7
  include Checker
10
8
 
9
+ sig { override.returns(Packwerk::ViolationType) }
11
10
  def violation_type
12
11
  ViolationType::Privacy
13
12
  end
14
13
 
15
- def invalid_reference?(reference, reference_lister)
16
- return if reference.constant.public?
14
+ sig do
15
+ override
16
+ .params(reference: Packwerk::Reference)
17
+ .returns(T::Boolean)
18
+ end
19
+ def invalid_reference?(reference)
20
+ return false if reference.constant.public?
17
21
 
18
22
  privacy_option = reference.constant.package.enforce_privacy
19
- return if enforcement_disabled?(privacy_option)
23
+ return false if enforcement_disabled?(privacy_option)
20
24
 
21
- return unless privacy_option == true ||
25
+ return false unless privacy_option == true ||
22
26
  explicitly_private_constant?(reference.constant, explicitly_private_constants: privacy_option)
23
27
 
24
- return if reference_lister.listed?(reference, violation_type: violation_type)
25
-
26
28
  true
27
29
  end
28
30
 
29
- def message_for(reference)
30
- source_desc = reference.source_package ? "'#{reference.source_package}'" : "here"
31
- "Privacy violation: '#{reference.constant.name}' is private to '#{reference.constant.package}' but " \
32
- "referenced from #{source_desc}.\n" \
33
- "Is there a public entrypoint in '#{reference.constant.package.public_path}' that you can use instead?"
34
- end
35
-
36
31
  private
37
32
 
33
+ sig do
34
+ params(
35
+ constant: ConstantDiscovery::ConstantContext,
36
+ explicitly_private_constants: T::Array[String]
37
+ ).returns(T::Boolean)
38
+ end
38
39
  def explicitly_private_constant?(constant, explicitly_private_constants:)
39
40
  explicitly_private_constants.include?(constant.name) ||
40
41
  # nested constants
41
42
  explicitly_private_constants.any? { |epc| constant.name.start_with?(epc + "::") }
42
43
  end
43
44
 
45
+ sig do
46
+ params(privacy_option: T.nilable(T.any(T::Boolean, T::Array[String])))
47
+ .returns(T::Boolean)
48
+ end
44
49
  def enforcement_disabled?(privacy_option)
45
50
  [false, nil].include?(privacy_option)
46
51
  end
@@ -1,14 +1,6 @@
1
1
  # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
- require "sorbet-runtime"
5
-
6
- require "packwerk/constant_discovery"
7
- require "packwerk/constant_name_inspector"
8
- require "packwerk/node"
9
- require "packwerk/parsed_constant_definitions"
10
- require "packwerk/reference"
11
-
12
4
  module Packwerk
13
5
  # extracts a possible constant reference from a given AST node
14
6
  class ReferenceExtractor
@@ -0,0 +1,49 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ class ReferenceOffense < Offense
6
+ extend T::Sig
7
+ extend T::Helpers
8
+
9
+ attr_reader :reference, :violation_type
10
+
11
+ sig do
12
+ params(
13
+ reference: Packwerk::Reference,
14
+ violation_type: Packwerk::ViolationType,
15
+ location: T.nilable(Node::Location)
16
+ )
17
+ .void
18
+ end
19
+ def initialize(reference:, violation_type:, location: nil)
20
+ super(file: reference.relative_path, message: build_message(reference, violation_type), location: location)
21
+ @reference = reference
22
+ @violation_type = violation_type
23
+ end
24
+
25
+ private
26
+
27
+ def build_message(reference, violation_type)
28
+ violation_message = case violation_type
29
+ when ViolationType::Privacy
30
+ source_desc = reference.source_package ? "'#{reference.source_package}'" : "here"
31
+ "Privacy violation: '#{reference.constant.name}' is private to '#{reference.constant.package}' but " \
32
+ "referenced from #{source_desc}.\n" \
33
+ "Is there a public entrypoint in '#{reference.constant.package.public_path}' that you can use instead?"
34
+ when ViolationType::Dependency
35
+ "Dependency violation: #{reference.constant.name} belongs to '#{reference.constant.package}', but " \
36
+ "'#{reference.source_package}' does not specify a dependency on " \
37
+ "'#{reference.constant.package}'.\n" \
38
+ "Are we missing an abstraction?\n" \
39
+ "Is the code making the reference, and the referenced constant, in the right packages?\n"
40
+ end
41
+
42
+ <<~EOS
43
+ #{violation_message}
44
+ Inference details: this is a reference to #{reference.constant.name} which seems to be defined in #{reference.constant.location}.
45
+ To receive help interpreting or resolving this error message, see: https://github.com/Shopify/packwerk/blob/main/TROUBLESHOOT.md#Troubleshooting-violations
46
+ EOS
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Packwerk
5
+ class Result < T::Struct
6
+ prop :message, String
7
+ prop :status, T::Boolean
8
+ end
9
+ end
@@ -3,17 +3,6 @@
3
3
 
4
4
  require "constant_resolver"
5
5
 
6
- require "packwerk/association_inspector"
7
- require "packwerk/constant_discovery"
8
- require "packwerk/const_node_inspector"
9
- require "packwerk/dependency_checker"
10
- require "packwerk/file_processor"
11
- require "packwerk/inflector"
12
- require "packwerk/package_set"
13
- require "packwerk/privacy_checker"
14
- require "packwerk/reference_extractor"
15
- require "packwerk/node_processor_factory"
16
-
17
6
  module Packwerk
18
7
  class RunContext
19
8
  extend T::Sig
@@ -27,23 +16,20 @@ module Packwerk
27
16
  :checker_classes,
28
17
  )
29
18
 
30
- attr_accessor :reference_lister
31
-
32
19
  DEFAULT_CHECKERS = [
33
20
  ::Packwerk::DependencyChecker,
34
21
  ::Packwerk::PrivacyChecker,
35
22
  ]
36
23
 
37
24
  class << self
38
- def from_configuration(configuration, reference_lister:)
25
+ def from_configuration(configuration)
39
26
  inflector = ::Packwerk::Inflector.from_file(configuration.inflections_file)
40
27
  new(
41
28
  root_path: configuration.root_path,
42
29
  load_paths: configuration.load_paths,
43
30
  package_paths: configuration.package_paths,
44
31
  inflector: inflector,
45
- custom_associations: configuration.custom_associations,
46
- reference_lister: reference_lister,
32
+ custom_associations: configuration.custom_associations
47
33
  )
48
34
  end
49
35
  end
@@ -54,8 +40,7 @@ module Packwerk
54
40
  package_paths: nil,
55
41
  inflector: nil,
56
42
  custom_associations: [],
57
- checker_classes: DEFAULT_CHECKERS,
58
- reference_lister:
43
+ checker_classes: DEFAULT_CHECKERS
59
44
  )
60
45
  @root_path = root_path
61
46
  @load_paths = load_paths
@@ -63,7 +48,6 @@ module Packwerk
63
48
  @inflector = inflector
64
49
  @custom_associations = custom_associations
65
50
  @checker_classes = checker_classes
66
- @reference_lister = reference_lister
67
51
  end
68
52
 
69
53
  sig { params(file: String).returns(T::Array[T.nilable(::Packwerk::Offense)]) }
@@ -84,8 +68,7 @@ module Packwerk
84
68
  context_provider: context_provider,
85
69
  checkers: checkers,
86
70
  root_path: root_path,
87
- constant_name_inspectors: constant_name_inspectors,
88
- reference_lister: reference_lister
71
+ constant_name_inspectors: constant_name_inspectors
89
72
  )
90
73
  end
91
74
 
@@ -1,8 +1,6 @@
1
- # typed: ignore
1
+ # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
- require "packwerk/application_validator"
5
-
6
4
  module Packwerk
7
5
  # To do: This alias and file should be removed as it is deprecated
8
6
  warn("DEPRECATION WARNING: Packwerk::SanityChecker is deprecated, use Packwerk::ApplicationValidator instead.")
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Packwerk
5
- VERSION = "1.1.0"
5
+ VERSION = "1.3.0"
6
6
  end
@@ -1,8 +1,6 @@
1
1
  # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
- require "sorbet-runtime"
5
-
6
4
  module Packwerk
7
5
  class ViolationType < T::Enum
8
6
  enums do
data/library.yml CHANGED
@@ -3,4 +3,4 @@ name: Packwerk
3
3
  stewards:
4
4
  - "@Shopify/kernel-architecture-patterns"
5
5
  slack_channels:
6
- - architecture-patterns
6
+ - code-foundations
data/packwerk.gemspec CHANGED
@@ -42,6 +42,7 @@ Gem::Specification.new do |spec|
42
42
 
43
43
  spec.add_dependency("activesupport", ">= 5.2")
44
44
  spec.add_dependency("constant_resolver")
45
+ spec.add_dependency("parallel")
45
46
  spec.add_dependency("sorbet-runtime")
46
47
 
47
48
  spec.add_development_dependency("bundler")
data/service.yml CHANGED
@@ -1,6 +1,3 @@
1
- # https://services.shopify.io/services/packwerk/production
2
- org_line: Kernel
3
- owners: Shopify/kernel-architecture-patterns
4
1
  classification: library
5
2
  slack_channels:
6
- - architecture-patterns
3
+ - core-stewardship
data/shipit.rubygems.yml CHANGED
@@ -1 +1,5 @@
1
- # default configs
1
+ dependencies:
2
+ override: []
3
+ deploy:
4
+ override:
5
+ - release-gem packwerk.gemspec rake release
@@ -1,6 +1,6 @@
1
1
  # DO NOT EDIT MANUALLY
2
2
  # This is an autogenerated file for types exported from the `actioncable` gem.
3
- # Please instead update this file by running `dev typecheck update`.
3
+ # Please instead update this file by running `bin/tapioca sync`.
4
4
 
5
5
  # typed: true
6
6
 
@@ -49,12 +49,12 @@ class ActionCable::Channel::Base
49
49
  def _unsubscribe_callbacks; end
50
50
  def connection; end
51
51
  def identifier; end
52
- def logger(*args, &block); end
52
+ def logger(*_arg0, &_arg1); end
53
53
  def params; end
54
54
  def perform_action(data); end
55
- def periodic_timers=(_); end
55
+ def periodic_timers=(_arg0); end
56
56
  def rescue_handlers; end
57
- def rescue_handlers=(_); end
57
+ def rescue_handlers=(_arg0); end
58
58
  def rescue_handlers?; end
59
59
  def subscribe_to_channel; end
60
60
  def unsubscribe_from_channel; end
@@ -107,8 +107,8 @@ module ActionCable::Channel::Broadcasting
107
107
 
108
108
  mixes_in_class_methods(::ActionCable::Channel::Broadcasting::ClassMethods)
109
109
 
110
- def broadcast_to(*args, &block); end
111
- def broadcasting_for(*args, &block); end
110
+ def broadcast_to(*_arg0, &_arg1); end
111
+ def broadcasting_for(*_arg0, &_arg1); end
112
112
  end
113
113
 
114
114
  module ActionCable::Channel::Broadcasting::ClassMethods
@@ -139,7 +139,7 @@ module ActionCable::Channel::Naming
139
139
 
140
140
  mixes_in_class_methods(::ActionCable::Channel::Naming::ClassMethods)
141
141
 
142
- def channel_name(*args, &block); end
142
+ def channel_name(*_arg0, &_arg1); end
143
143
  end
144
144
 
145
145
  module ActionCable::Channel::Naming::ClassMethods
@@ -167,13 +167,13 @@ end
167
167
  module ActionCable::Channel::Streams
168
168
  extend(::ActiveSupport::Concern)
169
169
 
170
- def pubsub(*args, &block); end
170
+ def pubsub(*_arg0, &_arg1); end
171
171
  def stop_all_streams; end
172
172
  def stop_stream_for(model); end
173
173
  def stop_stream_from(broadcasting); end
174
174
  def stream_for(model, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
175
175
  def stream_from(broadcasting, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
176
- def stream_or_reject_for(record); end
176
+ def stream_or_reject_for(model); end
177
177
 
178
178
  private
179
179
 
@@ -194,7 +194,7 @@ class ActionCable::Channel::TestCase < ::ActiveSupport::TestCase
194
194
  extend(::ActionCable::Channel::TestCase::Behavior::ClassMethods)
195
195
 
196
196
  def _channel_class; end
197
- def _channel_class=(_); end
197
+ def _channel_class=(_arg0); end
198
198
  def _channel_class?; end
199
199
  def connection; end
200
200
  def subscription; end
@@ -264,9 +264,9 @@ class ActionCable::Connection::Base
264
264
  def close(reason: T.unsafe(nil), reconnect: T.unsafe(nil)); end
265
265
  def dispatch_websocket_message(websocket_message); end
266
266
  def env; end
267
- def event_loop(*args, &block); end
267
+ def event_loop(*_arg0, &_arg1); end
268
268
  def identifiers; end
269
- def identifiers=(_); end
269
+ def identifiers=(_arg0); end
270
270
  def identifiers?; end
271
271
  def logger; end
272
272
  def on_close(reason, code); end
@@ -275,10 +275,10 @@ class ActionCable::Connection::Base
275
275
  def on_open; end
276
276
  def process; end
277
277
  def protocol; end
278
- def pubsub(*args, &block); end
278
+ def pubsub(*_arg0, &_arg1); end
279
279
  def receive(websocket_message); end
280
280
  def rescue_handlers; end
281
- def rescue_handlers=(_); end
281
+ def rescue_handlers=(_arg0); end
282
282
  def rescue_handlers?; end
283
283
  def send_async(method, *arguments); end
284
284
  def server; end
@@ -438,7 +438,7 @@ class ActionCable::Connection::Subscriptions
438
438
  def add(data); end
439
439
  def execute_command(data); end
440
440
  def identifiers; end
441
- def logger(*args, &block); end
441
+ def logger(*_arg0, &_arg1); end
442
442
  def perform_action(data); end
443
443
  def remove(data); end
444
444
  def remove_subscription(subscription); end
@@ -477,7 +477,7 @@ class ActionCable::Connection::TestCase < ::ActiveSupport::TestCase
477
477
  extend(::ActionCable::Connection::TestCase::Behavior::ClassMethods)
478
478
 
479
479
  def _connection_class; end
480
- def _connection_class=(_); end
480
+ def _connection_class=(_arg0); end
481
481
  def _connection_class?; end
482
482
  def connection; end
483
483
 
@@ -556,7 +556,7 @@ class ActionCable::RemoteConnections::RemoteConnection
556
556
 
557
557
  def disconnect; end
558
558
  def identifiers; end
559
- def identifiers=(_); end
559
+ def identifiers=(_arg0); end
560
560
  def identifiers?; end
561
561
 
562
562
  protected
@@ -593,7 +593,7 @@ class ActionCable::Server::Base
593
593
  def connection_identifiers; end
594
594
  def disconnect(identifiers); end
595
595
  def event_loop; end
596
- def logger(*args, &block); end
596
+ def logger(*_arg0, &_arg1); end
597
597
  def mutex; end
598
598
  def pubsub; end
599
599
  def remote_connections; end
@@ -625,26 +625,26 @@ class ActionCable::Server::Configuration
625
625
  def initialize; end
626
626
 
627
627
  def allow_same_origin_as_host; end
628
- def allow_same_origin_as_host=(_); end
628
+ def allow_same_origin_as_host=(_arg0); end
629
629
  def allowed_request_origins; end
630
- def allowed_request_origins=(_); end
630
+ def allowed_request_origins=(_arg0); end
631
631
  def cable; end
632
- def cable=(_); end
632
+ def cable=(_arg0); end
633
633
  def connection_class; end
634
- def connection_class=(_); end
634
+ def connection_class=(_arg0); end
635
635
  def disable_request_forgery_protection; end
636
- def disable_request_forgery_protection=(_); end
636
+ def disable_request_forgery_protection=(_arg0); end
637
637
  def log_tags; end
638
- def log_tags=(_); end
638
+ def log_tags=(_arg0); end
639
639
  def logger; end
640
- def logger=(_); end
640
+ def logger=(_arg0); end
641
641
  def mount_path; end
642
- def mount_path=(_); end
642
+ def mount_path=(_arg0); end
643
643
  def pubsub_adapter; end
644
644
  def url; end
645
- def url=(_); end
645
+ def url=(_arg0); end
646
646
  def worker_pool_size; end
647
- def worker_pool_size=(_); end
647
+ def worker_pool_size=(_arg0); end
648
648
  end
649
649
 
650
650
  module ActionCable::Server::Connections
@@ -659,15 +659,29 @@ ActionCable::Server::Connections::BEAT_INTERVAL = T.let(T.unsafe(nil), Integer)
659
659
 
660
660
  class ActionCable::Server::Worker
661
661
  include(::ActiveSupport::Callbacks)
662
+ include(::ActionCable::Server::Worker::ActiveRecordConnectionManagement)
662
663
  extend(::ActiveSupport::Callbacks::ClassMethods)
663
664
  extend(::ActiveSupport::DescendantsTracker)
664
665
 
666
+ def initialize(max_size: T.unsafe(nil)); end
667
+
665
668
  def __callbacks; end
666
669
  def __callbacks?; end
667
670
  def _run_work_callbacks(&block); end
668
671
  def _work_callbacks; end
672
+ def async_exec(receiver, *args, connection:, &block); end
673
+ def async_invoke(receiver, method, *args, connection: T.unsafe(nil), &block); end
669
674
  def connection; end
670
675
  def connection=(obj); end
676
+ def executor; end
677
+ def halt; end
678
+ def invoke(receiver, method, *args, connection:, &block); end
679
+ def stopping?; end
680
+ def work(connection); end
681
+
682
+ private
683
+
684
+ def logger; end
671
685
 
672
686
  class << self
673
687
  def __callbacks; end
@@ -680,6 +694,12 @@ class ActionCable::Server::Worker
680
694
  end
681
695
  end
682
696
 
697
+ module ActionCable::Server::Worker::ActiveRecordConnectionManagement
698
+ extend(::ActiveSupport::Concern)
699
+
700
+ def with_database_connections; end
701
+ end
702
+
683
703
  module ActionCable::SubscriptionAdapter
684
704
  extend(::ActiveSupport::Autoload)
685
705
  end
@@ -738,8 +758,8 @@ module ActionCable::TestHelper
738
758
  def assert_broadcasts(stream, number, &block); end
739
759
  def assert_no_broadcasts(stream, &block); end
740
760
  def before_setup; end
741
- def broadcasts(*args, &block); end
742
- def clear_messages(*args, &block); end
761
+ def broadcasts(*_arg0, &_arg1); end
762
+ def clear_messages(*_arg0, &_arg1); end
743
763
  def pubsub_adapter; end
744
764
 
745
765
  private
@@ -766,7 +786,7 @@ module ActionCable::Channel::ChannelStub
766
786
  def start_periodic_timers; end
767
787
  def stop_all_streams; end
768
788
  def stop_periodic_timers; end
769
- def stream_from(broadcasting, *_); end
789
+ def stream_from(broadcasting, *_arg1); end
770
790
  def streams; end
771
791
  end
772
792
 
@@ -806,9 +826,9 @@ end
806
826
 
807
827
  class ActionCable::Connection::TestRequest < ::ActionDispatch::TestRequest
808
828
  def cookie_jar; end
809
- def cookie_jar=(_); end
829
+ def cookie_jar=(_arg0); end
810
830
  def session; end
811
- def session=(_); end
831
+ def session=(_arg0); end
812
832
  end
813
833
 
814
834
  class ActionCable::SubscriptionAdapter::Async < ::ActionCable::SubscriptionAdapter::Inline
@@ -821,12 +841,12 @@ end
821
841
  class ActionCable::SubscriptionAdapter::Async::AsyncSubscriberMap < ::ActionCable::SubscriptionAdapter::SubscriberMap
822
842
  def initialize(event_loop); end
823
843
 
824
- def add_subscriber(*_); end
825
- def invoke_callback(*_); end
844
+ def add_subscriber(*_arg0); end
845
+ def invoke_callback(*_arg0); end
826
846
  end
827
847
 
828
848
  class ActionCable::SubscriptionAdapter::Inline < ::ActionCable::SubscriptionAdapter::Base
829
- def initialize(*_); end
849
+ def initialize(*_arg0); end
830
850
 
831
851
  def broadcast(channel, payload); end
832
852
  def shutdown; end