packwerk 3.0.0 → 3.2.2

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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/exe/packwerk +4 -1
  4. data/lib/packwerk/application_validator.rb +3 -0
  5. data/lib/packwerk/association_inspector.rb +17 -4
  6. data/lib/packwerk/checker.rb +16 -7
  7. data/lib/packwerk/cli.rb +14 -177
  8. data/lib/packwerk/commands/base_command.rb +69 -0
  9. data/lib/packwerk/commands/check_command.rb +62 -0
  10. data/lib/packwerk/commands/help_command.rb +33 -0
  11. data/lib/packwerk/commands/init_command.rb +42 -0
  12. data/lib/packwerk/commands/lazy_loaded_entry.rb +37 -0
  13. data/lib/packwerk/commands/update_todo_command.rb +60 -0
  14. data/lib/packwerk/commands/uses_parse_run.rb +92 -0
  15. data/lib/packwerk/commands/validate_command.rb +46 -0
  16. data/lib/packwerk/commands/version_command.rb +18 -0
  17. data/lib/packwerk/commands.rb +54 -0
  18. data/lib/packwerk/configuration.rb +8 -1
  19. data/lib/packwerk/const_node_inspector.rb +2 -2
  20. data/lib/packwerk/constant_name_inspector.rb +2 -2
  21. data/lib/packwerk/file_processor.rb +12 -1
  22. data/lib/packwerk/formatters/default_offenses_formatter.rb +3 -3
  23. data/lib/packwerk/formatters/progress_formatter.rb +11 -0
  24. data/lib/packwerk/generators/templates/package.yml +2 -2
  25. data/lib/packwerk/generators/templates/packwerk.yml.erb +1 -1
  26. data/lib/packwerk/offense_collection.rb +32 -12
  27. data/lib/packwerk/offenses_formatter.rb +14 -5
  28. data/lib/packwerk/package.rb +1 -1
  29. data/lib/packwerk/package_todo.rb +86 -69
  30. data/lib/packwerk/parse_run.rb +42 -82
  31. data/lib/packwerk/parsers/factory.rb +3 -3
  32. data/lib/packwerk/parsers/ruby.rb +9 -2
  33. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +3 -3
  34. data/lib/packwerk/reference_extractor.rb +29 -1
  35. data/lib/packwerk/reference_offense.rb +1 -1
  36. data/lib/packwerk/run_context.rb +15 -4
  37. data/lib/packwerk/spring_command.rb +0 -2
  38. data/lib/packwerk/validator.rb +19 -5
  39. data/lib/packwerk/version.rb +1 -1
  40. data/lib/packwerk.rb +5 -28
  41. data/sorbet/config +1 -0
  42. data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +3280 -3450
  43. data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +2322 -1782
  44. data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +2654 -3268
  45. data/sorbet/rbi/gems/ast@2.4.2.rbi +535 -6
  46. data/sorbet/rbi/gems/better_html@2.0.1.rbi +529 -0
  47. data/sorbet/rbi/gems/builder@3.2.4.rbi +4 -4
  48. data/sorbet/rbi/gems/byebug@11.1.3.rbi +32 -4
  49. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +1750 -1840
  50. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +15 -15
  51. data/sorbet/rbi/gems/crass@1.0.6.rbi +489 -5
  52. data/sorbet/rbi/gems/erubi@1.11.0.rbi +24 -21
  53. data/sorbet/rbi/gems/i18n@1.12.0.rbi +395 -395
  54. data/sorbet/rbi/gems/json@2.6.2.rbi +70 -77
  55. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +1 -1
  56. data/sorbet/rbi/gems/loofah@2.18.0.rbi +134 -134
  57. data/sorbet/rbi/gems/m@1.6.0.rbi +60 -60
  58. data/sorbet/rbi/gems/method_source@1.1.0.rbi +303 -0
  59. data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +22 -28
  60. data/sorbet/rbi/gems/minitest@5.16.2.rbi +384 -396
  61. data/sorbet/rbi/gems/mocha@1.14.0.rbi +589 -589
  62. data/sorbet/rbi/gems/netrc@0.11.0.rbi +37 -32
  63. data/sorbet/rbi/gems/{nokogiri@1.13.8.rbi → nokogiri@1.15.3.rbi} +1869 -1030
  64. data/sorbet/rbi/gems/{parallel@1.22.1.rbi → parallel@1.24.0.rbi} +85 -82
  65. data/sorbet/rbi/gems/parser@3.3.1.0.rbi +7320 -0
  66. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +1 -1
  67. data/sorbet/rbi/gems/prism@0.27.0.rbi +36983 -0
  68. data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.7.1.rbi} +42 -33
  69. data/sorbet/rbi/gems/rack-test@2.0.2.rbi +148 -338
  70. data/sorbet/rbi/gems/rack@2.2.4.rbi +1079 -1130
  71. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +354 -22
  72. data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +113 -259
  73. data/sorbet/rbi/gems/railties@7.0.3.1.rbi +642 -638
  74. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +109 -99
  75. data/sorbet/rbi/gems/rake@13.0.6.rbi +714 -599
  76. data/sorbet/rbi/gems/{rbi@0.0.15.rbi → rbi@0.1.12.rbi} +865 -801
  77. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +853 -870
  78. data/sorbet/rbi/gems/rexml@3.2.5.rbi +480 -477
  79. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +1621 -1622
  80. data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +507 -526
  81. data/sorbet/rbi/gems/rubocop-shopify@2.9.0.rbi +1 -1
  82. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +186 -203
  83. data/sorbet/rbi/gems/rubocop@1.34.1.rbi +8126 -8367
  84. data/sorbet/rbi/gems/{ruby-lsp@0.2.1.rbi → ruby-lsp@0.2.3.rbi} +2 -2
  85. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1235 -4
  86. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +90 -90
  87. data/sorbet/rbi/gems/spoom@1.3.2.rbi +4420 -0
  88. data/sorbet/rbi/gems/spring@4.0.0.rbi +104 -104
  89. data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +1 -1
  90. data/sorbet/rbi/gems/{tapioca@0.9.2.rbi → tapioca@0.13.3.rbi} +1596 -1253
  91. data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.3.1.rbi} +1047 -652
  92. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +531 -513
  93. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +13 -13
  94. data/sorbet/rbi/gems/{yard-sorbet@0.6.1.rbi → yard-sorbet@0.8.1.rbi} +132 -92
  95. data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.36.rbi} +3158 -3067
  96. data/sorbet/rbi/gems/zeitwerk@2.6.4.rbi +149 -145
  97. metadata +36 -84
  98. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
  99. data/.github/pull_request_template.md +0 -28
  100. data/.github/workflows/ci.yml +0 -65
  101. data/.github/workflows/cla.yml +0 -22
  102. data/.gitignore +0 -13
  103. data/.rubocop.yml +0 -75
  104. data/.ruby-version +0 -1
  105. data/CODEOWNERS +0 -1
  106. data/CODE_OF_CONDUCT.md +0 -76
  107. data/CONTRIBUTING.md +0 -17
  108. data/Gemfile +0 -27
  109. data/Gemfile.lock +0 -201
  110. data/RESOLVING_VIOLATIONS.md +0 -81
  111. data/Rakefile +0 -13
  112. data/TROUBLESHOOT.md +0 -45
  113. data/UPGRADING.md +0 -54
  114. data/USAGE.md +0 -367
  115. data/bin/console +0 -15
  116. data/bin/m +0 -29
  117. data/bin/rake +0 -29
  118. data/bin/rubocop +0 -29
  119. data/bin/setup +0 -8
  120. data/bin/srb +0 -29
  121. data/bin/tapioca +0 -29
  122. data/dev.yml +0 -32
  123. data/docs/cohesion.png +0 -0
  124. data/gemfiles/Gemfile-rails-6-0 +0 -22
  125. data/gemfiles/Gemfile-rails-6-1 +0 -22
  126. data/lib/packwerk/cli/result.rb +0 -11
  127. data/packwerk.gemspec +0 -58
  128. data/shipit.rubygems.yml +0 -5
  129. data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +0 -2754
  130. data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +0 -1496
  131. data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +0 -2362
  132. data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +0 -1569
  133. data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +0 -2553
  134. data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +0 -5999
  135. data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +0 -37832
  136. data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +0 -2321
  137. data/sorbet/rbi/gems/better_html@1.0.16.rbi +0 -317
  138. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
  139. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1079
  140. data/sorbet/rbi/gems/digest@3.1.0.rbi +0 -189
  141. data/sorbet/rbi/gems/globalid@1.0.0.rbi +0 -572
  142. data/sorbet/rbi/gems/mail@2.7.1.rbi +0 -2490
  143. data/sorbet/rbi/gems/marcel@1.0.2.rbi +0 -220
  144. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -76
  145. data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +0 -170
  146. data/sorbet/rbi/gems/net-imap@0.2.3.rbi +0 -2147
  147. data/sorbet/rbi/gems/net-pop@0.1.1.rbi +0 -926
  148. data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +0 -11
  149. data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +0 -1108
  150. data/sorbet/rbi/gems/nio4r@2.5.8.rbi +0 -292
  151. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +0 -9029
  152. data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
  153. data/sorbet/rbi/gems/rails@7.0.3.1.rbi +0 -8
  154. data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -2181
  155. data/sorbet/rbi/gems/strscan@3.0.4.rbi +0 -8
  156. data/sorbet/rbi/gems/timeout@0.3.0.rbi +0 -142
  157. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
  158. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2582
  159. data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +0 -993
  160. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -71
@@ -1,8 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `strscan` gem.
5
- # Please instead update this file by running `bin/tapioca gem strscan`.
6
-
7
- # THIS IS AN EMPTY RBI FILE.
8
- # see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires
@@ -1,142 +0,0 @@
1
- # typed: false
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `timeout` gem.
5
- # Please instead update this file by running `bin/tapioca gem timeout`.
6
-
7
- # source://timeout-0.3.0/lib/timeout.rb:25
8
- module Timeout
9
- private
10
-
11
- # Perform an operation in a block, raising an error if it takes longer than
12
- # +sec+ seconds to complete.
13
- #
14
- # +sec+:: Number of seconds to wait for the block to terminate. Any number
15
- # may be used, including Floats to specify fractional seconds. A
16
- # value of 0 or +nil+ will execute the block without any timeout.
17
- # +klass+:: Exception Class to raise if the block fails to terminate
18
- # in +sec+ seconds. Omitting will use the default, Timeout::Error
19
- # +message+:: Error message to raise with Exception Class.
20
- # Omitting will use the default, "execution expired"
21
- #
22
- # Returns the result of the block *if* the block completed before
23
- # +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
24
- #
25
- # The exception thrown to terminate the given block cannot be rescued inside
26
- # the block unless +klass+ is given explicitly. However, the block can use
27
- # ensure to prevent the handling of the exception. For that reason, this
28
- # method cannot be relied on to enforce timeouts for untrusted blocks.
29
- #
30
- # If a scheduler is defined, it will be used to handle the timeout by invoking
31
- # Scheduler#timeout_after.
32
- #
33
- # Note that this is both a method of module Timeout, so you can <tt>include
34
- # Timeout</tt> into your classes so they have a #timeout method, as well as
35
- # a module method, so you can call it directly as Timeout.timeout().
36
- #
37
- # source://timeout-0.3.0/lib/timeout.rb:162
38
- def timeout(sec, klass = T.unsafe(nil), message = T.unsafe(nil), &block); end
39
-
40
- class << self
41
- # source://timeout-0.3.0/lib/timeout.rb:126
42
- def ensure_timeout_thread_created; end
43
-
44
- # Perform an operation in a block, raising an error if it takes longer than
45
- # +sec+ seconds to complete.
46
- #
47
- # +sec+:: Number of seconds to wait for the block to terminate. Any number
48
- # may be used, including Floats to specify fractional seconds. A
49
- # value of 0 or +nil+ will execute the block without any timeout.
50
- # +klass+:: Exception Class to raise if the block fails to terminate
51
- # in +sec+ seconds. Omitting will use the default, Timeout::Error
52
- # +message+:: Error message to raise with Exception Class.
53
- # Omitting will use the default, "execution expired"
54
- #
55
- # Returns the result of the block *if* the block completed before
56
- # +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
57
- #
58
- # The exception thrown to terminate the given block cannot be rescued inside
59
- # the block unless +klass+ is given explicitly. However, the block can use
60
- # ensure to prevent the handling of the exception. For that reason, this
61
- # method cannot be relied on to enforce timeouts for untrusted blocks.
62
- #
63
- # If a scheduler is defined, it will be used to handle the timeout by invoking
64
- # Scheduler#timeout_after.
65
- #
66
- # Note that this is both a method of module Timeout, so you can <tt>include
67
- # Timeout</tt> into your classes so they have a #timeout method, as well as
68
- # a module method, so you can call it directly as Timeout.timeout().
69
- #
70
- # source://timeout-0.3.0/lib/timeout.rb:162
71
- def timeout(sec, klass = T.unsafe(nil), message = T.unsafe(nil), &block); end
72
-
73
- private
74
-
75
- # source://timeout-0.3.0/lib/timeout.rb:100
76
- def create_timeout_thread; end
77
- end
78
- end
79
-
80
- # :stopdoc:
81
- #
82
- # source://timeout-0.3.0/lib/timeout.rb:53
83
- Timeout::CONDVAR = T.let(T.unsafe(nil), Thread::ConditionVariable)
84
-
85
- # Raised by Timeout.timeout when the block times out.
86
- #
87
- # source://timeout-0.3.0/lib/timeout.rb:29
88
- class Timeout::Error < ::RuntimeError
89
- # source://timeout-0.3.0/lib/timeout.rb:39
90
- def exception(*_arg0); end
91
-
92
- # Returns the value of attribute thread.
93
- #
94
- # source://timeout-0.3.0/lib/timeout.rb:30
95
- def thread; end
96
-
97
- class << self
98
- # source://timeout-0.3.0/lib/timeout.rb:32
99
- def catch(*args); end
100
- end
101
- end
102
-
103
- # source://timeout-0.3.0/lib/timeout.rb:54
104
- Timeout::QUEUE = T.let(T.unsafe(nil), Thread::Queue)
105
-
106
- # source://timeout-0.3.0/lib/timeout.rb:55
107
- Timeout::QUEUE_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
108
-
109
- # source://timeout-0.3.0/lib/timeout.rb:60
110
- class Timeout::Request
111
- # @return [Request] a new instance of Request
112
- #
113
- # source://timeout-0.3.0/lib/timeout.rb:63
114
- def initialize(thread, timeout, exception_class, message); end
115
-
116
- # Returns the value of attribute deadline.
117
- #
118
- # source://timeout-0.3.0/lib/timeout.rb:61
119
- def deadline; end
120
-
121
- # @return [Boolean]
122
- #
123
- # source://timeout-0.3.0/lib/timeout.rb:73
124
- def done?; end
125
-
126
- # @return [Boolean]
127
- #
128
- # source://timeout-0.3.0/lib/timeout.rb:79
129
- def expired?(now); end
130
-
131
- # source://timeout-0.3.0/lib/timeout.rb:92
132
- def finished; end
133
-
134
- # source://timeout-0.3.0/lib/timeout.rb:83
135
- def interrupt; end
136
- end
137
-
138
- # source://timeout-0.3.0/lib/timeout.rb:56
139
- Timeout::TIMEOUT_THREAD_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
140
-
141
- # source://timeout-0.3.0/lib/timeout.rb:26
142
- Timeout::VERSION = T.let(T.unsafe(nil), String)