packwerk 3.2.3 → 3.3.1

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 (124) hide show
  1. checksums.yaml +4 -4
  2. data/exe/packwerk +0 -4
  3. data/lib/packwerk/application_validator.rb +11 -10
  4. data/lib/packwerk/association_inspector.rb +21 -32
  5. data/lib/packwerk/cache.rb +43 -36
  6. data/lib/packwerk/checker.rb +24 -26
  7. data/lib/packwerk/cli.rb +13 -20
  8. data/lib/packwerk/commands/base_command.rb +20 -26
  9. data/lib/packwerk/commands/check_command.rb +8 -8
  10. data/lib/packwerk/commands/help_command.rb +3 -4
  11. data/lib/packwerk/commands/init_command.rb +2 -3
  12. data/lib/packwerk/commands/lazy_loaded_entry.rb +5 -7
  13. data/lib/packwerk/commands/update_todo_command.rb +3 -3
  14. data/lib/packwerk/commands/uses_parse_run.rb +20 -26
  15. data/lib/packwerk/commands/validate_command.rb +6 -7
  16. data/lib/packwerk/commands/version_command.rb +2 -3
  17. data/lib/packwerk/commands.rb +5 -8
  18. data/lib/packwerk/configuration.rb +29 -43
  19. data/lib/packwerk/const_node_inspector.rb +11 -15
  20. data/lib/packwerk/constant_context.rb +0 -2
  21. data/lib/packwerk/constant_discovery.rb +3 -16
  22. data/lib/packwerk/constant_name_inspector.rb +4 -11
  23. data/lib/packwerk/extension_loader.rb +1 -2
  24. data/lib/packwerk/file_processor.rb +20 -25
  25. data/lib/packwerk/files_for_processing.rb +13 -29
  26. data/lib/packwerk/formatters/default_offenses_formatter.rb +14 -12
  27. data/lib/packwerk/formatters/progress_formatter.rb +10 -12
  28. data/lib/packwerk/generators/configuration_file.rb +5 -9
  29. data/lib/packwerk/generators/root_package.rb +3 -7
  30. data/lib/packwerk/graph.rb +1 -7
  31. data/lib/packwerk/node_helpers.rb +32 -38
  32. data/lib/packwerk/node_processor.rb +2 -14
  33. data/lib/packwerk/node_processor_factory.rb +13 -7
  34. data/lib/packwerk/node_visitor.rb +2 -10
  35. data/lib/packwerk/offense.rb +6 -12
  36. data/lib/packwerk/offense_collection.rb +22 -35
  37. data/lib/packwerk/offenses_formatter.rb +27 -34
  38. data/lib/packwerk/output_style.rb +10 -11
  39. data/lib/packwerk/output_styles/coloured.rb +6 -4
  40. data/lib/packwerk/output_styles/plain.rb +6 -4
  41. data/lib/packwerk/package.rb +15 -16
  42. data/lib/packwerk/package_set.rb +15 -25
  43. data/lib/packwerk/package_todo.rb +21 -30
  44. data/lib/packwerk/parse_run.rb +10 -37
  45. data/lib/packwerk/parsed_constant_definitions.rb +10 -24
  46. data/lib/packwerk/parsers/erb.rb +11 -22
  47. data/lib/packwerk/parsers/factory.rb +9 -9
  48. data/lib/packwerk/parsers/parser_interface.rb +5 -10
  49. data/lib/packwerk/parsers/ruby.rb +9 -14
  50. data/lib/packwerk/parsers.rb +2 -4
  51. data/lib/packwerk/rails_load_paths.rb +6 -11
  52. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +10 -15
  53. data/lib/packwerk/reference_checking/reference_checker.rb +2 -8
  54. data/lib/packwerk/reference_extractor.rb +22 -55
  55. data/lib/packwerk/reference_offense.rb +5 -15
  56. data/lib/packwerk/run_context.rb +28 -39
  57. data/lib/packwerk/spring_command.rb +4 -7
  58. data/lib/packwerk/validator/result.rb +12 -5
  59. data/lib/packwerk/validator.rb +23 -33
  60. data/lib/packwerk/validators/dependency_validator.rb +9 -10
  61. data/lib/packwerk/version.rb +1 -1
  62. data/lib/packwerk.rb +0 -1
  63. metadata +15 -76
  64. data/lib/packwerk/disable_sorbet.rb +0 -41
  65. data/sorbet/config +0 -4
  66. data/sorbet/rbi/gems/actionpack@7.0.8.7.rbi +0 -19338
  67. data/sorbet/rbi/gems/actionview@7.0.8.7.rbi +0 -15492
  68. data/sorbet/rbi/gems/activesupport@7.0.8.7.rbi +0 -18283
  69. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -584
  70. data/sorbet/rbi/gems/better_html@2.1.1.rbi +0 -529
  71. data/sorbet/rbi/gems/builder@3.3.0.rbi +0 -8
  72. data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -36
  73. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +0 -11656
  74. data/sorbet/rbi/gems/constant_resolver@0.3.0.rbi +0 -99
  75. data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -622
  76. data/sorbet/rbi/gems/erubi@1.13.1.rbi +0 -154
  77. data/sorbet/rbi/gems/i18n@1.14.7.rbi +0 -2358
  78. data/sorbet/rbi/gems/json@2.7.2.rbi +0 -1561
  79. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14237
  80. data/sorbet/rbi/gems/loofah@2.24.0.rbi +0 -1104
  81. data/sorbet/rbi/gems/m@1.6.0.rbi +0 -257
  82. data/sorbet/rbi/gems/method_source@1.1.0.rbi +0 -303
  83. data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +0 -98
  84. data/sorbet/rbi/gems/minitest@5.25.4.rbi +0 -2229
  85. data/sorbet/rbi/gems/mocha@2.5.0.rbi +0 -3961
  86. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -158
  87. data/sorbet/rbi/gems/nokogiri@1.18.4.rbi +0 -8204
  88. data/sorbet/rbi/gems/parallel@1.25.1.rbi +0 -286
  89. data/sorbet/rbi/gems/parser@3.3.3.0.rbi +0 -7320
  90. data/sorbet/rbi/gems/prism@0.27.0.rbi +0 -36983
  91. data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -161
  92. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +0 -736
  93. data/sorbet/rbi/gems/rack@2.2.13.rbi +0 -5633
  94. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +0 -754
  95. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +0 -764
  96. data/sorbet/rbi/gems/railties@7.0.8.7.rbi +0 -3517
  97. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -402
  98. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -3039
  99. data/sorbet/rbi/gems/rbi@0.1.12.rbi +0 -3071
  100. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +0 -3771
  101. data/sorbet/rbi/gems/rexml@3.3.9.rbi +0 -4857
  102. data/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi +0 -7089
  103. data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +0 -2967
  104. data/sorbet/rbi/gems/rubocop-shopify@2.9.0.rbi +0 -8
  105. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +0 -975
  106. data/sorbet/rbi/gems/rubocop@1.64.1.rbi +0 -58089
  107. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1317
  108. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +0 -8
  109. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +0 -474
  110. data/sorbet/rbi/gems/spoom@1.3.2.rbi +0 -4420
  111. data/sorbet/rbi/gems/spring@4.0.0.rbi +0 -411
  112. data/sorbet/rbi/gems/tapioca@0.13.3.rbi +0 -3524
  113. data/sorbet/rbi/gems/thor@1.3.1.rbi +0 -4351
  114. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5917
  115. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +0 -65
  116. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +0 -428
  117. data/sorbet/rbi/gems/yard@0.9.36.rbi +0 -18333
  118. data/sorbet/rbi/gems/zeitwerk@2.6.4.rbi +0 -934
  119. data/sorbet/rbi/shims/minitest/test.rb +0 -8
  120. data/sorbet/rbi/shims/packwerk/reference.rbi +0 -33
  121. data/sorbet/rbi/shims/packwerk/unresolved_reference.rbi +0 -33
  122. data/sorbet/rbi/shims/parser.rbi +0 -13
  123. data/sorbet/rbi/shims/psych.rbi +0 -5
  124. data/sorbet/tapioca/require.rb +0 -25
@@ -1,257 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `m` gem.
5
- # Please instead update this file by running `bin/tapioca gem m`.
6
-
7
- # Runners are in charge of running your tests, depending on the framework
8
- # Instead of slamming all of this junk in an `M` class, it's here instead.
9
- #
10
- # source://m//lib/m/version.rb#1
11
- module M
12
- class << self
13
- # Accept arguments coming from bin/m and run tests, then bail out immediately.
14
- #
15
- # source://m//lib/m.rb#9
16
- def run(argv); end
17
- end
18
- end
19
-
20
- # source://m//lib/m/executor.rb#8
21
- class M::Executor
22
- # @return [Executor] a new instance of Executor
23
- #
24
- # source://m//lib/m/executor.rb#9
25
- def initialize(testable); end
26
-
27
- # source://m//lib/m/executor.rb#13
28
- def execute; end
29
-
30
- private
31
-
32
- # source://m//lib/m/executor.rb#96
33
- def runner; end
34
-
35
- # Finds all test suites in this test file, with test methods included.
36
- #
37
- # source://m//lib/m/executor.rb#72
38
- def suites; end
39
-
40
- # Returns the value of attribute testable.
41
- #
42
- # source://m//lib/m/executor.rb#50
43
- def testable; end
44
-
45
- # Shoves tests together in our custom container and collection classes.
46
- # Memoize it since it's unnecessary to do this more than one for a given file.
47
- #
48
- # source://m//lib/m/executor.rb#54
49
- def tests; end
50
- end
51
-
52
- # source://m//lib/m/frameworks.rb#2
53
- class M::Frameworks
54
- # source://m//lib/m/frameworks.rb#7
55
- def framework_runner; end
56
-
57
- private
58
-
59
- # @return [Boolean]
60
- #
61
- # source://m//lib/m/frameworks.rb#25
62
- def minitest4?; end
63
-
64
- # @return [Boolean]
65
- #
66
- # source://m//lib/m/frameworks.rb#21
67
- def minitest5?; end
68
-
69
- # @return [Boolean]
70
- #
71
- # source://m//lib/m/frameworks.rb#29
72
- def test_unit?; end
73
-
74
- class << self
75
- # source://m//lib/m/frameworks.rb#3
76
- def framework_runner; end
77
-
78
- # @return [Boolean]
79
- #
80
- # source://m//lib/m/frameworks.rb#41
81
- def minitest4?; end
82
-
83
- # @return [Boolean]
84
- #
85
- # source://m//lib/m/frameworks.rb#37
86
- def minitest5?; end
87
-
88
- # source://m//lib/m/frameworks.rb#33
89
- def minitest_version_major; end
90
-
91
- # @return [Boolean]
92
- #
93
- # source://m//lib/m/frameworks.rb#45
94
- def test_unit?; end
95
- end
96
- end
97
-
98
- # source://m//lib/m/parser.rb#4
99
- class M::Parser
100
- # @return [Parser] a new instance of Parser
101
- #
102
- # source://m//lib/m/parser.rb#5
103
- def initialize(argv); end
104
-
105
- # source://m//lib/m/parser.rb#10
106
- def parse; end
107
-
108
- private
109
-
110
- # Returns the value of attribute argv.
111
- #
112
- # source://m//lib/m/parser.rb#56
113
- def argv; end
114
-
115
- # source://m//lib/m/parser.rb#58
116
- def parse_options!(argv); end
117
-
118
- # Returns the value of attribute testable.
119
- #
120
- # source://m//lib/m/parser.rb#56
121
- def testable; end
122
-
123
- # source://m//lib/m/parser.rb#89
124
- def wildcard(type); end
125
- end
126
-
127
- # source://m//lib/m/runner.rb#7
128
- class M::Runner
129
- # @return [Runner] a new instance of Runner
130
- #
131
- # source://m//lib/m/runner.rb#8
132
- def initialize(argv); end
133
-
134
- # There's two steps to running our tests:
135
- # 1. Parsing the given input for the tests we need to find (or groups of tests)
136
- # 2. Run those tests we found that match what you wanted
137
- #
138
- # source://m//lib/m/runner.rb#15
139
- def run; end
140
- end
141
-
142
- # source://m//lib/m/runners/base.rb#2
143
- module M::Runners; end
144
-
145
- # source://m//lib/m/runners/base.rb#3
146
- class M::Runners::Base
147
- # source://m//lib/m/runners/base.rb#8
148
- def run(_test_arguments); end
149
-
150
- # source://m//lib/m/runners/base.rb#4
151
- def suites; end
152
-
153
- # source://m//lib/m/runners/base.rb#12
154
- def test_methods(suite_class); end
155
- end
156
-
157
- # source://m//lib/m/runners/minitest_4.rb#3
158
- class M::Runners::Minitest4 < ::M::Runners::Base
159
- # source://m//lib/m/runners/minitest_4.rb#8
160
- def run(test_arguments); end
161
-
162
- # source://m//lib/m/runners/minitest_4.rb#4
163
- def suites; end
164
- end
165
-
166
- # source://m//lib/m/runners/minitest_5.rb#3
167
- class M::Runners::Minitest5 < ::M::Runners::Base
168
- # source://m//lib/m/runners/minitest_5.rb#8
169
- def run(test_arguments); end
170
-
171
- # source://m//lib/m/runners/minitest_5.rb#4
172
- def suites; end
173
-
174
- # source://m//lib/m/runners/minitest_5.rb#14
175
- def test_methods(suite_class); end
176
- end
177
-
178
- # source://m//lib/m/runners/test_unit.rb#3
179
- class M::Runners::TestUnit < ::M::Runners::Base
180
- # source://m//lib/m/runners/test_unit.rb#12
181
- def run(test_arguments); end
182
-
183
- # source://m//lib/m/runners/test_unit.rb#4
184
- def suites; end
185
-
186
- # source://m//lib/m/runners/test_unit.rb#16
187
- def test_methods(suite_class); end
188
- end
189
-
190
- # source://m//lib/m/runners/unsupported_framework.rb#3
191
- class M::Runners::UnsupportedFramework < ::M::Runners::Base
192
- # source://m//lib/m/runners/unsupported_framework.rb#9
193
- def run(_test_arguments); end
194
-
195
- # source://m//lib/m/runners/unsupported_framework.rb#4
196
- def suites; end
197
-
198
- private
199
-
200
- # source://m//lib/m/runners/unsupported_framework.rb#15
201
- def not_supported; end
202
- end
203
-
204
- # source://m//lib/m/testable.rb#2
205
- class M::Testable
206
- # @return [Testable] a new instance of Testable
207
- #
208
- # source://m//lib/m/testable.rb#6
209
- def initialize(file = T.unsafe(nil), lines = T.unsafe(nil), recursive = T.unsafe(nil)); end
210
-
211
- # Returns the value of attribute file.
212
- #
213
- # source://m//lib/m/testable.rb#3
214
- def file; end
215
-
216
- # Sets the attribute file
217
- #
218
- # @param value the value to set the attribute file to.
219
- #
220
- # source://m//lib/m/testable.rb#3
221
- def file=(_arg0); end
222
-
223
- # Returns the value of attribute lines.
224
- #
225
- # source://m//lib/m/testable.rb#4
226
- def lines; end
227
-
228
- # source://m//lib/m/testable.rb#13
229
- def lines=(lines); end
230
-
231
- # Returns the value of attribute passthrough_options.
232
- #
233
- # source://m//lib/m/testable.rb#3
234
- def passthrough_options; end
235
-
236
- # Sets the attribute passthrough_options
237
- #
238
- # @param value the value to set the attribute passthrough_options to.
239
- #
240
- # source://m//lib/m/testable.rb#3
241
- def passthrough_options=(_arg0); end
242
-
243
- # Returns the value of attribute recursive.
244
- #
245
- # source://m//lib/m/testable.rb#3
246
- def recursive; end
247
-
248
- # Sets the attribute recursive
249
- #
250
- # @param value the value to set the attribute recursive to.
251
- #
252
- # source://m//lib/m/testable.rb#3
253
- def recursive=(_arg0); end
254
- end
255
-
256
- # source://m//lib/m/version.rb#2
257
- M::VERSION = T.let(T.unsafe(nil), String)
@@ -1,303 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `method_source` gem.
5
- # Please instead update this file by running `bin/tapioca gem method_source`.
6
-
7
- # source://method_source//lib/method_source.rb#163
8
- class Method
9
- include ::MethodSource::SourceLocation::MethodExtensions
10
- include ::MethodSource::MethodExtensions
11
- end
12
-
13
- # source://method_source//lib/method_source/version.rb#1
14
- module MethodSource
15
- extend ::MethodSource::CodeHelpers
16
-
17
- class << self
18
- # Clear cache.
19
- #
20
- # source://method_source//lib/method_source.rb#59
21
- def clear_cache; end
22
-
23
- # Helper method responsible for opening source file and buffering up
24
- # the comments for a specified method. Defined here to avoid polluting
25
- # `Method` class.
26
- #
27
- # @param source_location [Array] The array returned by Method#source_location
28
- # @param method_name [String]
29
- # @raise [SourceNotFoundError]
30
- # @return [String] The comments up to the point of the method.
31
- #
32
- # source://method_source//lib/method_source.rb#38
33
- def comment_helper(source_location, name = T.unsafe(nil)); end
34
-
35
- # @deprecated — use MethodSource::CodeHelpers#expression_at
36
- #
37
- # source://method_source//lib/method_source.rb#71
38
- def extract_code(source_location); end
39
-
40
- # Load a memoized copy of the lines in a file.
41
- #
42
- # @param file_name [String]
43
- # @param method_name [String]
44
- # @raise [SourceNotFoundError]
45
- # @return [Array<String>] the contents of the file
46
- #
47
- # source://method_source//lib/method_source.rb#51
48
- def lines_for(file_name, name = T.unsafe(nil)); end
49
-
50
- # Helper method responsible for extracting method body.
51
- # Defined here to avoid polluting `Method` class.
52
- #
53
- # @param source_location [Array] The array returned by Method#source_location
54
- # @param method_name [String]
55
- # @return [String] The method body
56
- #
57
- # source://method_source//lib/method_source.rb#23
58
- def source_helper(source_location, name = T.unsafe(nil)); end
59
-
60
- # @deprecated — use MethodSource::CodeHelpers#complete_expression?
61
- # @return [Boolean]
62
- #
63
- # source://method_source//lib/method_source.rb#64
64
- def valid_expression?(str); end
65
- end
66
- end
67
-
68
- # source://method_source//lib/method_source/code_helpers.rb#3
69
- module MethodSource::CodeHelpers
70
- # Retrieve the comment describing the expression on the given line of the given file.
71
- #
72
- # This is useful to get module or method documentation.
73
- #
74
- # @param file [Array<String>, File, String] The file to parse, either as a File or as
75
- # a String or an Array of lines.
76
- # @param line_number [Integer] The line number at which to look.
77
- # NOTE: The first line in a file is line 1!
78
- # @return [String] The comment
79
- #
80
- # source://method_source//lib/method_source/code_helpers.rb#52
81
- def comment_describing(file, line_number); end
82
-
83
- # Determine if a string of code is a complete Ruby expression.
84
- #
85
- # @example
86
- # complete_expression?("class Hello") #=> false
87
- # complete_expression?("class Hello; end") #=> true
88
- # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER
89
- # @param code [String] The code to validate.
90
- # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness.
91
- # @return [Boolean] Whether or not the code is a complete Ruby expression.
92
- #
93
- # source://method_source//lib/method_source/code_helpers.rb#66
94
- def complete_expression?(str); end
95
-
96
- # Retrieve the first expression starting on the given line of the given file.
97
- #
98
- # This is useful to get module or method source code.
99
- #
100
- # line 1!
101
- #
102
- # @option options
103
- # @option options
104
- # @param file [Array<String>, File, String] The file to parse, either as a File or as
105
- # @param line_number [Integer] The line number at which to look.
106
- # NOTE: The first line in a file is
107
- # @param options [Hash] The optional configuration parameters.
108
- # @raise [SyntaxError] If the first complete expression can't be identified
109
- # @return [String] The first complete expression
110
- #
111
- # source://method_source//lib/method_source/code_helpers.rb#20
112
- def expression_at(file, line_number, options = T.unsafe(nil)); end
113
-
114
- private
115
-
116
- # Get the first expression from the input.
117
- #
118
- # @param lines [Array<String>]
119
- # @param consume [Integer] A number of lines to automatically
120
- # consume (add to the expression buffer) without checking for validity.
121
- # @raise [SyntaxError]
122
- # @return [String] a valid ruby expression
123
- # @yield a clean-up function to run before checking for complete_expression
124
- #
125
- # source://method_source//lib/method_source/code_helpers.rb#92
126
- def extract_first_expression(lines, consume = T.unsafe(nil), &block); end
127
-
128
- # Get the last comment from the input.
129
- #
130
- # @param lines [Array<String>]
131
- # @return [String]
132
- #
133
- # source://method_source//lib/method_source/code_helpers.rb#106
134
- def extract_last_comment(lines); end
135
- end
136
-
137
- # An exception matcher that matches only subsets of SyntaxErrors that can be
138
- # fixed by adding more input to the buffer.
139
- #
140
- # source://method_source//lib/method_source/code_helpers.rb#124
141
- module MethodSource::CodeHelpers::IncompleteExpression
142
- class << self
143
- # source://method_source//lib/method_source/code_helpers.rb#137
144
- def ===(ex); end
145
-
146
- # @return [Boolean]
147
- #
148
- # source://method_source//lib/method_source/code_helpers.rb#149
149
- def rbx?; end
150
- end
151
- end
152
-
153
- # source://method_source//lib/method_source/code_helpers.rb#125
154
- MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array)
155
-
156
- # source://method_source//lib/method_source/code_helpers.rb#133
157
- MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array)
158
-
159
- # This module is to be included by `Method` and `UnboundMethod` and
160
- # provides the `#source` functionality
161
- #
162
- # source://method_source//lib/method_source.rb#77
163
- module MethodSource::MethodExtensions
164
- # Return the comments associated with the method class/module.
165
- #
166
- # @example
167
- # MethodSource::MethodExtensions.method(:included).module_comment
168
- # =>
169
- # # This module is to be included by `Method` and `UnboundMethod` and
170
- # # provides the `#source` functionality
171
- # @raise SourceNotFoundException
172
- # @return [String] The method's comments as a string
173
- #
174
- # source://method_source//lib/method_source.rb#139
175
- def class_comment; end
176
-
177
- # Return the comments associated with the method as a string.
178
- #
179
- # @example
180
- # Set.instance_method(:clear).comment.display
181
- # =>
182
- # # Removes all elements and returns self.
183
- # @raise SourceNotFoundException
184
- # @return [String] The method's comments as a string
185
- #
186
- # source://method_source//lib/method_source.rb#126
187
- def comment; end
188
-
189
- # Return the comments associated with the method class/module.
190
- #
191
- # @example
192
- # MethodSource::MethodExtensions.method(:included).module_comment
193
- # =>
194
- # # This module is to be included by `Method` and `UnboundMethod` and
195
- # # provides the `#source` functionality
196
- # @raise SourceNotFoundException
197
- # @return [String] The method's comments as a string
198
- #
199
- # source://method_source//lib/method_source.rb#139
200
- def module_comment; end
201
-
202
- # Return the sourcecode for the method as a string
203
- #
204
- # @example
205
- # Set.instance_method(:clear).source.display
206
- # =>
207
- # def clear
208
- # @hash.clear
209
- # self
210
- # end
211
- # @raise SourceNotFoundException
212
- # @return [String] The method sourcecode as a string
213
- #
214
- # source://method_source//lib/method_source.rb#114
215
- def source; end
216
-
217
- class << self
218
- # We use the included hook to patch Method#source on rubinius.
219
- # We need to use the included hook as Rubinius defines a `source`
220
- # on Method so including a module will have no effect (as it's
221
- # higher up the MRO).
222
- #
223
- # @param klass [Class] The class that includes the module.
224
- #
225
- # source://method_source//lib/method_source.rb#84
226
- def included(klass); end
227
- end
228
- end
229
-
230
- # source://method_source//lib/method_source/source_location.rb#2
231
- module MethodSource::ReeSourceLocation
232
- # Ruby enterprise edition provides all the information that's
233
- # needed, in a slightly different way.
234
- #
235
- # source://method_source//lib/method_source/source_location.rb#5
236
- def source_location; end
237
- end
238
-
239
- # source://method_source//lib/method_source/source_location.rb#10
240
- module MethodSource::SourceLocation; end
241
-
242
- # source://method_source//lib/method_source/source_location.rb#11
243
- module MethodSource::SourceLocation::MethodExtensions
244
- # Return the source location of a method for Ruby 1.8.
245
- #
246
- # @return [Array] A two element array. First element is the
247
- # file, second element is the line in the file where the
248
- # method definition is found.
249
- #
250
- # source://method_source//lib/method_source/source_location.rb#40
251
- def source_location; end
252
-
253
- private
254
-
255
- # source://method_source//lib/method_source/source_location.rb#26
256
- def trace_func(event, file, line, id, binding, classname); end
257
- end
258
-
259
- # source://method_source//lib/method_source/source_location.rb#54
260
- module MethodSource::SourceLocation::ProcExtensions
261
- # Return the source location for a Proc (in implementations
262
- # without Proc#source_location)
263
- #
264
- # @return [Array] A two element array. First element is the
265
- # file, second element is the line in the file where the
266
- # proc definition is found.
267
- #
268
- # source://method_source//lib/method_source/source_location.rb#74
269
- def source_location; end
270
- end
271
-
272
- # source://method_source//lib/method_source/source_location.rb#81
273
- module MethodSource::SourceLocation::UnboundMethodExtensions
274
- # Return the source location of an instance method for Ruby 1.8.
275
- #
276
- # @return [Array] A two element array. First element is the
277
- # file, second element is the line in the file where the
278
- # method definition is found.
279
- #
280
- # source://method_source//lib/method_source/source_location.rb#101
281
- def source_location; end
282
- end
283
-
284
- # An Exception to mark errors that were raised trying to find the source from
285
- # a given source_location.
286
- #
287
- # source://method_source//lib/method_source.rb#16
288
- class MethodSource::SourceNotFoundError < ::StandardError; end
289
-
290
- # source://method_source//lib/method_source/version.rb#2
291
- MethodSource::VERSION = T.let(T.unsafe(nil), String)
292
-
293
- # source://method_source//lib/method_source.rb#173
294
- class Proc
295
- include ::MethodSource::SourceLocation::ProcExtensions
296
- include ::MethodSource::MethodExtensions
297
- end
298
-
299
- # source://method_source//lib/method_source.rb#168
300
- class UnboundMethod
301
- include ::MethodSource::SourceLocation::UnboundMethodExtensions
302
- include ::MethodSource::MethodExtensions
303
- end
@@ -1,98 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `minitest-focus` gem.
5
- # Please instead update this file by running `bin/tapioca gem minitest-focus`.
6
-
7
- # source://minitest-focus//lib/minitest/focus.rb#3
8
- class Minitest::Test < ::Minitest::Runnable
9
- include ::Mocha::ParameterMatchers
10
- include ::Mocha::Hooks
11
- include ::Mocha::API
12
-
13
- # source://minitest/5.16.2/lib/minitest/test.rb#194
14
- def capture_exceptions; end
15
-
16
- # source://minitest/5.16.2/lib/minitest/test.rb#15
17
- def class_name; end
18
-
19
- # source://minitest/5.16.2/lib/minitest/test.rb#211
20
- def neuter_exception(e); end
21
-
22
- # source://minitest/5.16.2/lib/minitest/test.rb#222
23
- def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end
24
-
25
- # source://minitest/5.16.2/lib/minitest/test.rb#92
26
- def run; end
27
-
28
- # source://minitest/5.16.2/lib/minitest/test.rb#204
29
- def sanitize_exception(e); end
30
-
31
- # source://minitest/5.16.2/lib/minitest/test.rb#236
32
- def with_info_handler(&block); end
33
-
34
- class << self
35
- # source://minitest-focus//lib/minitest/focus.rb#10
36
- def add_to_filter(name); end
37
-
38
- # source://minitest-focus//lib/minitest/focus.rb#14
39
- def filtered_names; end
40
-
41
- # Focus on the next test defined. Cumulative. Equivalent to
42
- # running with command line arg: -n /test_name|.../
43
- #
44
- # class MyTest < Minitest::Test
45
- #
46
- # # direct approach
47
- # focus def test_method1 # will run
48
- # ...
49
- # end
50
- #
51
- # # indirect approach
52
- # focus
53
- # def test_method2 # will run
54
- # ...
55
- # end
56
- #
57
- # def test_method3 # will NOT run
58
- # ...
59
- # end
60
- # end
61
- #
62
- # source://minitest-focus//lib/minitest/focus.rb#40
63
- def focus(name = T.unsafe(nil)); end
64
-
65
- # source://minitest/5.16.2/lib/minitest/test.rb#31
66
- def i_suck_and_my_tests_are_order_dependent!; end
67
-
68
- # source://minitest/5.16.2/lib/minitest/test.rb#22
69
- def io_lock; end
70
-
71
- # source://minitest/5.16.2/lib/minitest/test.rb#22
72
- def io_lock=(_arg0); end
73
-
74
- # source://minitest/5.16.2/lib/minitest/test.rb#44
75
- def make_my_diffs_pretty!; end
76
-
77
- # source://minitest/5.16.2/lib/minitest/test.rb#55
78
- def parallelize_me!; end
79
-
80
- # source://minitest/5.16.2/lib/minitest/test.rb#65
81
- def runnable_methods; end
82
-
83
- # Sets a one-off method_added callback to set focus on the method
84
- # defined next.
85
- #
86
- # source://minitest-focus//lib/minitest/focus.rb#52
87
- def set_focus_trap; end
88
-
89
- # source://minitest/5.16.2/lib/minitest/test.rb#83
90
- def test_order; end
91
- end
92
- end
93
-
94
- # source://minitest-focus//lib/minitest/focus.rb#4
95
- class Minitest::Test::Focus; end
96
-
97
- # source://minitest-focus//lib/minitest/focus.rb#5
98
- Minitest::Test::Focus::VERSION = T.let(T.unsafe(nil), String)