mangrove 0.30.1 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +107 -43
  3. data/lib/mangrove/result.rb +78 -0
  4. data/lib/mangrove/version.rb +1 -1
  5. data/lib/tapioca/dsl/compilers/mangrove_enum.rb +7 -1
  6. data/sorbet/config +1 -0
  7. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  8. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  9. data/sorbet/rbi/gems/{docile@1.4.0.rbi → docile@1.4.1.rbi} +2 -1
  10. data/sorbet/rbi/gems/{erubi@1.12.0.rbi → erubi@1.13.1.rbi} +26 -17
  11. data/sorbet/rbi/gems/{json@2.7.2.rbi → json@2.9.1.rbi} +516 -134
  12. data/sorbet/rbi/gems/logger@1.6.5.rbi +940 -0
  13. data/sorbet/rbi/gems/{parallel@1.24.0.rbi → parallel@1.26.3.rbi} +31 -21
  14. data/sorbet/rbi/gems/{parser@3.3.2.0.rbi → parser@3.3.7.0.rbi} +23 -1736
  15. data/sorbet/rbi/gems/{prism@0.29.0.rbi → prism@1.3.0.rbi} +13817 -10401
  16. data/sorbet/rbi/gems/{psych@5.1.2.rbi → psych@5.2.3.rbi} +289 -236
  17. data/sorbet/rbi/gems/{racc@1.8.0.rbi → racc@1.8.1.rbi} +0 -4
  18. data/sorbet/rbi/gems/rbi@0.2.3.rbi +4542 -0
  19. data/sorbet/rbi/gems/rbs@3.8.1.rbi +6882 -0
  20. data/sorbet/rbi/gems/{rdoc@6.7.0.rbi → rdoc@6.11.0.rbi} +1115 -1058
  21. data/sorbet/rbi/gems/{regexp_parser@2.9.2.rbi → regexp_parser@2.10.0.rbi} +193 -170
  22. data/sorbet/rbi/gems/{rspec-core@3.13.0.rbi → rspec-core@3.13.2.rbi} +146 -280
  23. data/sorbet/rbi/gems/{rspec-expectations@3.13.0.rbi → rspec-expectations@3.13.3.rbi} +323 -294
  24. data/sorbet/rbi/gems/{rspec-mocks@3.13.1.rbi → rspec-mocks@3.13.2.rbi} +46 -46
  25. data/sorbet/rbi/gems/{rspec-support@3.13.1.rbi → rspec-support@3.13.2.rbi} +22 -22
  26. data/sorbet/rbi/gems/ruboclean@0.7.1.rbi +473 -0
  27. data/sorbet/rbi/gems/{rubocop-ast@1.31.3.rbi → rubocop-ast@1.37.0.rbi} +1293 -745
  28. data/sorbet/rbi/gems/{rubocop-rspec@2.30.0.rbi → rubocop-rspec@3.4.0.rbi} +341 -1073
  29. data/sorbet/rbi/gems/{rubocop@1.64.1.rbi → rubocop@1.70.0.rbi} +5693 -3796
  30. data/sorbet/rbi/gems/{simplecov-html@0.12.3.rbi → simplecov-html@0.13.1.rbi} +77 -68
  31. data/sorbet/rbi/gems/{spoom@1.3.2.rbi → spoom@1.5.1.rbi} +2306 -1701
  32. data/sorbet/rbi/gems/{stringio@3.1.0.rbi → stringio@3.1.2.rbi} +1 -0
  33. data/sorbet/rbi/gems/{tapioca@0.14.3.rbi → tapioca@0.16.8.rbi} +411 -332
  34. data/sorbet/rbi/gems/{thor@1.3.1.rbi → thor@1.3.2.rbi} +57 -31
  35. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  36. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  37. data/sorbet/rbi/gems/{webrick@1.8.1.rbi → webrick@1.9.1.rbi} +92 -72
  38. data/sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi → yard-sorbet@0.9.0.rbi} +36 -29
  39. data/sorbet/rbi/gems/{yard@0.9.36.rbi → yard@0.9.37.rbi} +393 -235
  40. metadata +39 -42
  41. data/sorbet/rbi/gems/rbi@0.1.13.rbi +0 -3078
  42. data/sorbet/rbi/gems/rexml@3.2.8.rbi +0 -4794
  43. data/sorbet/rbi/gems/ruboclean@0.6.0.rbi +0 -315
  44. data/sorbet/rbi/gems/rubocop-capybara@2.20.0.rbi +0 -1208
  45. data/sorbet/rbi/gems/rubocop-factory_bot@2.25.1.rbi +0 -928
  46. data/sorbet/rbi/gems/rubocop-rspec_rails@2.28.3.rbi +0 -911
  47. data/sorbet/rbi/gems/strscan@3.1.0.rbi +0 -9
  48. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +0 -65
  49. /data/sorbet/rbi/gems/{io-console@0.7.2.rbi → io-console@0.8.0.rbi} +0 -0
  50. /data/sorbet/rbi/gems/{reline@0.5.8.rbi → reline@0.6.0.rbi} +0 -0
  51. /data/sorbet/rbi/gems/{ruby-lsp@0.17.2.rbi → ruby-lsp@0.23.6.rbi} +0 -0
@@ -1,928 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `rubocop-factory_bot` gem.
5
- # Please instead update this file by running `bin/tapioca gem rubocop-factory_bot`.
6
-
7
-
8
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#3
9
- module RuboCop; end
10
-
11
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb#4
12
- module RuboCop::Cop; end
13
-
14
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb#5
15
- module RuboCop::Cop::FactoryBot; end
16
-
17
- # Use a consistent style to define associations.
18
- #
19
- # @example EnforcedStyle: implicit (default)
20
- # # bad
21
- # factory :post do
22
- # association :user
23
- # end
24
- #
25
- # # good
26
- # factory :post do
27
- # user
28
- # end
29
- #
30
- # # bad
31
- # factory :post do
32
- # association :user, :author
33
- # end
34
- #
35
- # # good
36
- # factory :post do
37
- # user factory: %i[user author]
38
- # end
39
- # @example EnforcedStyle: explicit
40
- # # bad
41
- # factory :post do
42
- # user
43
- # end
44
- #
45
- # # good
46
- # factory :post do
47
- # association :user
48
- # end
49
- #
50
- # # bad
51
- # factory :post do
52
- # user factory: %i[user author]
53
- # end
54
- #
55
- # # good
56
- # factory :post do
57
- # association :user, :author
58
- # end
59
- #
60
- # # good (NonImplicitAssociationMethodNames: ['email'])
61
- # sequence :email do |n|
62
- # "person#{n}@example.com"
63
- # end
64
- #
65
- # factory :user do
66
- # email
67
- # end
68
- #
69
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#63
70
- class RuboCop::Cop::FactoryBot::AssociationStyle < ::RuboCop::Cop::Base
71
- include ::RuboCop::Cop::ConfigurableEnforcedStyle
72
- extend ::RuboCop::Cop::AutoCorrector
73
-
74
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#139
75
- def association_names(param0); end
76
-
77
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#96
78
- def explicit_association?(param0 = T.unsafe(nil)); end
79
-
80
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#113
81
- def factory_option_matcher(param0 = T.unsafe(nil)); end
82
-
83
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#108
84
- def implicit_association?(param0 = T.unsafe(nil)); end
85
-
86
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#82
87
- def on_send(node); end
88
-
89
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#144
90
- def trait_name(param0); end
91
-
92
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#134
93
- def trait_names_from_explicit(param0 = T.unsafe(nil)); end
94
-
95
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#101
96
- def with_strategy_build_option?(param0 = T.unsafe(nil)); end
97
-
98
- private
99
-
100
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#148
101
- def autocorrect(corrector, node); end
102
-
103
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#156
104
- def autocorrect_to_explicit_style(corrector, node); end
105
-
106
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#164
107
- def autocorrect_to_implicit_style(corrector, node); end
108
-
109
- # @return [Boolean]
110
- #
111
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#174
112
- def bad?(node); end
113
-
114
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#195
115
- def bad_associations_in(node); end
116
-
117
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#201
118
- def children_of_factory_block(node); end
119
-
120
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#213
121
- def factory_names_from_explicit(node); end
122
-
123
- # @return [Boolean]
124
- #
125
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#185
126
- def keyword?(node); end
127
-
128
- # @return [Boolean]
129
- #
130
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#223
131
- def non_implicit_association_method_name?(method_name); end
132
-
133
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#227
134
- def non_implicit_association_method_names; end
135
-
136
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#240
137
- def options_for_autocorrect_to_implicit_style(node); end
138
-
139
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#232
140
- def options_from_explicit(node); end
141
-
142
- # @return [Boolean]
143
- #
144
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#249
145
- def trait_within_trait?(node); end
146
- end
147
-
148
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#68
149
- RuboCop::Cop::FactoryBot::AssociationStyle::DEFAULT_NON_IMPLICIT_ASSOCIATION_METHOD_NAMES = T.let(T.unsafe(nil), Array)
150
-
151
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#76
152
- RuboCop::Cop::FactoryBot::AssociationStyle::KEYWORDS = T.let(T.unsafe(nil), Array)
153
-
154
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/association_style.rb#75
155
- RuboCop::Cop::FactoryBot::AssociationStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
156
-
157
- # Always declare attribute values as blocks.
158
- #
159
- # @example
160
- # # bad
161
- # kind [:active, :rejected].sample
162
- #
163
- # # good
164
- # kind { [:active, :rejected].sample }
165
- #
166
- # # bad
167
- # closed_at 1.day.from_now
168
- #
169
- # # good
170
- # closed_at { 1.day.from_now }
171
- #
172
- # # bad
173
- # count 1
174
- #
175
- # # good
176
- # count { 1 }
177
- #
178
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#27
179
- class RuboCop::Cop::FactoryBot::AttributeDefinedStatically < ::RuboCop::Cop::Base
180
- extend ::RuboCop::Cop::AutoCorrector
181
-
182
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#85
183
- def association?(param0 = T.unsafe(nil)); end
184
-
185
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#38
186
- def factory_attributes(param0 = T.unsafe(nil)); end
187
-
188
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#42
189
- def on_block(node); end
190
-
191
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#33
192
- def value_matcher(param0 = T.unsafe(nil)); end
193
-
194
- private
195
-
196
- # @return [Boolean]
197
- #
198
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#119
199
- def attribute_defining_method?(method_name); end
200
-
201
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#58
202
- def autocorrect(corrector, node); end
203
-
204
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#87
205
- def autocorrect_replacing_parens(corrector, node); end
206
-
207
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#94
208
- def autocorrect_without_parens(corrector, node); end
209
-
210
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#103
211
- def braces(node); end
212
-
213
- # @return [Boolean]
214
- #
215
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#66
216
- def offensive_receiver?(receiver, node); end
217
-
218
- # @return [Boolean]
219
- #
220
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#80
221
- def proc?(attribute); end
222
-
223
- # @return [Boolean]
224
- #
225
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#72
226
- def receiver_matches_first_block_argument?(receiver, node); end
227
-
228
- # @return [Boolean]
229
- #
230
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#115
231
- def reserved_method?(method_name); end
232
-
233
- # @return [Boolean]
234
- #
235
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#111
236
- def value_hash_without_braces?(node); end
237
- end
238
-
239
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/attribute_defined_statically.rb#30
240
- RuboCop::Cop::FactoryBot::AttributeDefinedStatically::MSG = T.let(T.unsafe(nil), String)
241
-
242
- # Handles `ExplicitOnly` configuration parameters.
243
- #
244
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb#7
245
- module RuboCop::Cop::FactoryBot::ConfigurableExplicitOnly
246
- include ::RuboCop::FactoryBot::Language
247
-
248
- # @return [Boolean]
249
- #
250
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb#16
251
- def explicit_only?; end
252
-
253
- # @return [Boolean]
254
- #
255
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb#10
256
- def factory_call?(node); end
257
- end
258
-
259
- # Use a consistent style for parentheses in factory_bot calls.
260
- #
261
- # @example `EnforcedStyle: require_parentheses` (default)
262
- #
263
- # # bad
264
- # create :user
265
- # build :login
266
- #
267
- # # good
268
- # create(:user)
269
- # build(:login)
270
- # @example `EnforcedStyle: omit_parentheses`
271
- #
272
- # # bad
273
- # create(:user)
274
- # build(:login)
275
- #
276
- # # good
277
- # create :user
278
- # build :login
279
- #
280
- # # also good
281
- # # when method name and first argument are not on same line
282
- # create(
283
- # :user
284
- # )
285
- # build(
286
- # :user,
287
- # name: 'foo'
288
- # )
289
- # @example `ExplicitOnly: false` (default)
290
- #
291
- # # bad - with `EnforcedStyle: require_parentheses`
292
- # FactoryBot.create :user
293
- # build :user
294
- #
295
- # # good - with `EnforcedStyle: require_parentheses`
296
- # FactoryBot.create(:user)
297
- # build(:user)
298
- # @example `ExplicitOnly: true`
299
- #
300
- # # bad - with `EnforcedStyle: require_parentheses`
301
- # FactoryBot.create :user
302
- # FactoryBot.build :user
303
- #
304
- # # good - with `EnforcedStyle: require_parentheses`
305
- # FactoryBot.create(:user)
306
- # FactoryBot.build(:user)
307
- # create :user
308
- # build :user
309
- #
310
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#60
311
- class RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle < ::RuboCop::Cop::Base
312
- include ::RuboCop::Cop::ConfigurableEnforcedStyle
313
- include ::RuboCop::FactoryBot::Language
314
- include ::RuboCop::Cop::FactoryBot::ConfigurableExplicitOnly
315
- extend ::RuboCop::Cop::AutoCorrector
316
-
317
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#71
318
- def factory_call(param0 = T.unsafe(nil)); end
319
-
320
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#79
321
- def omit_hash_value?(param0 = T.unsafe(nil)); end
322
-
323
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#93
324
- def on_send(node); end
325
-
326
- private
327
-
328
- # @return [Boolean]
329
- #
330
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#130
331
- def ambiguous_without_parentheses?(node); end
332
-
333
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#101
334
- def register_offense(node); end
335
-
336
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#108
337
- def register_offense_with_parentheses(node); end
338
-
339
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#119
340
- def register_offense_without_parentheses(node); end
341
-
342
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#134
343
- def remove_parentheses(corrector, node); end
344
-
345
- class << self
346
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#89
347
- def autocorrect_incompatible_with; end
348
- end
349
- end
350
-
351
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#128
352
- RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle::AMBIGUOUS_TYPES = T.let(T.unsafe(nil), Array)
353
-
354
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#67
355
- RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle::FACTORY_CALLS = T.let(T.unsafe(nil), Set)
356
-
357
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#66
358
- RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle::MSG_OMIT_PARENS = T.let(T.unsafe(nil), String)
359
-
360
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#65
361
- RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle::MSG_REQUIRE_PARENS = T.let(T.unsafe(nil), String)
362
-
363
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb#68
364
- RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
365
-
366
- # Checks for create_list usage.
367
- #
368
- # This cop can be configured using the `EnforcedStyle` option
369
- #
370
- # @example `EnforcedStyle: create_list` (default)
371
- # # bad
372
- # 3.times { create :user }
373
- # 3.times.map { create :user }
374
- # [create(:user), create(:user), create(:user)]
375
- # Array.new(3) { create :user }
376
- #
377
- # # good
378
- # create_list :user, 3
379
- #
380
- # # bad
381
- # 3.times { create :user, age: 18 }
382
- #
383
- # # good - index is used to alter the created models attributes
384
- # 3.times { |n| create :user, age: n }
385
- #
386
- # # good - contains a method call, may return different values
387
- # 3.times { create :user, age: rand }
388
- # @example `EnforcedStyle: n_times`
389
- # # bad
390
- # create_list :user, 3
391
- # [create(:user), create(:user), create(:user)]
392
- #
393
- # # good
394
- # 3.times.map { create :user }
395
- # @example `ExplicitOnly: false` (default)
396
- #
397
- # # bad - with `EnforcedStyle: create_list`
398
- # 3.times { FactoryBot.create :user }
399
- # 3.times { create :user }
400
- #
401
- # # good - with `EnforcedStyle: create_list`
402
- # FactoryBot.create_list :user, 3
403
- # create_list :user, 3
404
- # @example `ExplicitOnly: true`
405
- #
406
- # # bad - with `EnforcedStyle: create_list`
407
- # 3.times { FactoryBot.create :user }
408
- #
409
- # # good - with `EnforcedStyle: create_list`
410
- # FactoryBot.create_list :user, 3
411
- # create_list :user, 3
412
- # 3.times { create :user }
413
- #
414
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#61
415
- class RuboCop::Cop::FactoryBot::CreateList < ::RuboCop::Cop::Base
416
- include ::RuboCop::Cop::ConfigurableEnforcedStyle
417
- include ::RuboCop::FactoryBot::Language
418
- include ::RuboCop::Cop::FactoryBot::ConfigurableExplicitOnly
419
- extend ::RuboCop::Cop::AutoCorrector
420
-
421
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#92
422
- def arguments_include_method_call?(param0 = T.unsafe(nil)); end
423
-
424
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#83
425
- def block_with_arg_and_used?(param0 = T.unsafe(nil)); end
426
-
427
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#97
428
- def factory_call(param0 = T.unsafe(nil)); end
429
-
430
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#107
431
- def factory_calls_in_array?(param0); end
432
-
433
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#102
434
- def factory_list_call(param0 = T.unsafe(nil)); end
435
-
436
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#111
437
- def on_array(node); end
438
-
439
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#123
440
- def on_block(node); end
441
-
442
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#136
443
- def on_send(node); end
444
-
445
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#72
446
- def repeat_count(param0 = T.unsafe(nil)); end
447
-
448
- private
449
-
450
- # For ease of modification, it is replaced with the `n_times` style,
451
- # but if it is not appropriate for the configured style,
452
- # it will be replaced in the subsequent autocorrection.
453
- #
454
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#160
455
- def autocorrect_same_factory_calls_in_array(corrector, node); end
456
-
457
- # @return [Boolean]
458
- #
459
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#171
460
- def contains_only_factory?(node); end
461
-
462
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#179
463
- def preferred_message_for_array(node); end
464
-
465
- # @return [Boolean]
466
- #
467
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#151
468
- def repeat_multiple_time?(node); end
469
-
470
- # @return [Boolean]
471
- #
472
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#188
473
- def same_factory_calls_in_array?(node); end
474
- end
475
-
476
- # :nodoc
477
- #
478
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#194
479
- module RuboCop::Cop::FactoryBot::CreateList::Corrector
480
- private
481
-
482
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#197
483
- def build_options_string(options); end
484
-
485
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#201
486
- def format_method_call(node, method, arguments); end
487
-
488
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#209
489
- def format_receiver(receiver); end
490
- end
491
-
492
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#254
493
- class RuboCop::Cop::FactoryBot::CreateList::CreateListCorrector
494
- include ::RuboCop::Cop::FactoryBot::CreateList::Corrector
495
-
496
- # @return [CreateListCorrector] a new instance of CreateListCorrector
497
- #
498
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#257
499
- def initialize(node); end
500
-
501
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#261
502
- def call(corrector); end
503
-
504
- private
505
-
506
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#284
507
- def build_arguments(node, count); end
508
-
509
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#293
510
- def call_replacement(node); end
511
-
512
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#275
513
- def call_with_block_replacement(node); end
514
-
515
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#306
516
- def count_from(node); end
517
-
518
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#319
519
- def format_block(node); end
520
-
521
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#327
522
- def format_multiline_block(node); end
523
-
524
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#335
525
- def format_singleline_block(node); end
526
-
527
- # Returns the value of attribute node.
528
- #
529
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#273
530
- def node; end
531
- end
532
-
533
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#67
534
- RuboCop::Cop::FactoryBot::CreateList::MSG_CREATE_LIST = T.let(T.unsafe(nil), String)
535
-
536
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#68
537
- RuboCop::Cop::FactoryBot::CreateList::MSG_N_TIMES = T.let(T.unsafe(nil), String)
538
-
539
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#69
540
- RuboCop::Cop::FactoryBot::CreateList::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
541
-
542
- # :nodoc
543
- #
544
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#217
545
- class RuboCop::Cop::FactoryBot::CreateList::TimesCorrector
546
- include ::RuboCop::Cop::FactoryBot::CreateList::Corrector
547
-
548
- # @return [TimesCorrector] a new instance of TimesCorrector
549
- #
550
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#220
551
- def initialize(node); end
552
-
553
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#224
554
- def call(corrector); end
555
-
556
- private
557
-
558
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#246
559
- def factory_call_block_source; end
560
-
561
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#233
562
- def generate_n_times_block(node); end
563
-
564
- # Returns the value of attribute node.
565
- #
566
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/create_list.rb#231
567
- def node; end
568
- end
569
-
570
- # Check for excessive model creation in a list.
571
- #
572
- # @example MaxAmount: 10 (default)
573
- # # We do not allow more than 10 items to be created
574
- #
575
- # # bad
576
- # create_list(:merge_request, 1000, state: :opened)
577
- #
578
- # # good
579
- # create_list(:merge_request, 10, state: :opened)
580
- # @example MaxAmount: 20
581
- # # We do not allow more than 20 items to be created
582
- #
583
- # # bad
584
- # create_list(:merge_request, 1000, state: :opened)
585
- #
586
- # # good
587
- # create_list(:merge_request, 15, state: :opened)
588
- #
589
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/excessive_create_list.rb#26
590
- class RuboCop::Cop::FactoryBot::ExcessiveCreateList < ::RuboCop::Cop::Base
591
- include ::RuboCop::FactoryBot::Language
592
- include ::RuboCop::Cop::FactoryBot::ConfigurableExplicitOnly
593
-
594
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/excessive_create_list.rb#33
595
- def create_list?(param0 = T.unsafe(nil)); end
596
-
597
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/excessive_create_list.rb#39
598
- def on_send(node); end
599
- end
600
-
601
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/excessive_create_list.rb#29
602
- RuboCop::Cop::FactoryBot::ExcessiveCreateList::MESSAGE = T.let(T.unsafe(nil), String)
603
-
604
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/excessive_create_list.rb#37
605
- RuboCop::Cop::FactoryBot::ExcessiveCreateList::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
606
-
607
- # Use definition in factory association instead of hard coding a strategy.
608
- #
609
- # @example
610
- # # bad - only works for one strategy
611
- # factory :foo do
612
- # profile { create(:profile) }
613
- # end
614
- #
615
- # # good - implicit
616
- # factory :foo do
617
- # profile
618
- # end
619
- #
620
- # # good - explicit
621
- # factory :foo do
622
- # association :profile
623
- # end
624
- #
625
- # # good - inline
626
- # factory :foo do
627
- # profile { association :profile }
628
- # end
629
- #
630
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#29
631
- class RuboCop::Cop::FactoryBot::FactoryAssociationWithStrategy < ::RuboCop::Cop::Base
632
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#36
633
- def factory_declaration(param0 = T.unsafe(nil)); end
634
-
635
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#43
636
- def factory_strategy_association(param0 = T.unsafe(nil)); end
637
-
638
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#51
639
- def on_block(node); end
640
- end
641
-
642
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#33
643
- RuboCop::Cop::FactoryBot::FactoryAssociationWithStrategy::HARDCODED = T.let(T.unsafe(nil), Set)
644
-
645
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_association_with_strategy.rb#30
646
- RuboCop::Cop::FactoryBot::FactoryAssociationWithStrategy::MSG = T.let(T.unsafe(nil), String)
647
-
648
- # Use string value when setting the class attribute explicitly.
649
- #
650
- # This cop would promote faster tests by lazy-loading of
651
- # application files. Also, this could help you suppress potential bugs
652
- # in combination with external libraries by avoiding a preload of
653
- # application files from the factory files.
654
- #
655
- # @example
656
- # # bad
657
- # factory :foo, class: Foo do
658
- # end
659
- #
660
- # # good
661
- # factory :foo, class: 'Foo' do
662
- # end
663
- #
664
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#22
665
- class RuboCop::Cop::FactoryBot::FactoryClassName < ::RuboCop::Cop::Base
666
- extend ::RuboCop::Cop::AutoCorrector
667
-
668
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#31
669
- def class_name(param0 = T.unsafe(nil)); end
670
-
671
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#35
672
- def on_send(node); end
673
-
674
- private
675
-
676
- # @return [Boolean]
677
- #
678
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#48
679
- def allowed?(const_name); end
680
- end
681
-
682
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#27
683
- RuboCop::Cop::FactoryBot::FactoryClassName::ALLOWED_CONSTANTS = T.let(T.unsafe(nil), Array)
684
-
685
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#25
686
- RuboCop::Cop::FactoryBot::FactoryClassName::MSG = T.let(T.unsafe(nil), String)
687
-
688
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_class_name.rb#28
689
- RuboCop::Cop::FactoryBot::FactoryClassName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
690
-
691
- # Checks for name style for argument of FactoryBot::Syntax::Methods.
692
- #
693
- # @example EnforcedStyle: symbol (default)
694
- # # bad
695
- # create('user')
696
- # build "user", username: "NAME"
697
- #
698
- # # good
699
- # create(:user)
700
- # build :user, username: "NAME"
701
- #
702
- # # good - namespaced models
703
- # create('users/internal')
704
- # @example EnforcedStyle: string
705
- # # bad
706
- # create(:user)
707
- # build :user, username: "NAME"
708
- #
709
- # # good
710
- # create('user')
711
- # build "user", username: "NAME"
712
- # @example `ExplicitOnly: false` (default)
713
- #
714
- # # bad - with `EnforcedStyle: symbol`
715
- # FactoryBot.create('user')
716
- # create('user')
717
- #
718
- # # good - with `EnforcedStyle: symbol`
719
- # FactoryBot.create(:user)
720
- # create(:user)
721
- # @example `ExplicitOnly: true`
722
- #
723
- # # bad - with `EnforcedStyle: symbol`
724
- # FactoryBot.create(:user)
725
- # FactoryBot.build "user", username: "NAME"
726
- #
727
- # # good - with `EnforcedStyle: symbol`
728
- # FactoryBot.create('user')
729
- # FactoryBot.build "user", username: "NAME"
730
- # FactoryBot.create(:user)
731
- # create(:user)
732
- #
733
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#51
734
- class RuboCop::Cop::FactoryBot::FactoryNameStyle < ::RuboCop::Cop::Base
735
- include ::RuboCop::Cop::ConfigurableEnforcedStyle
736
- include ::RuboCop::FactoryBot::Language
737
- include ::RuboCop::Cop::FactoryBot::ConfigurableExplicitOnly
738
- extend ::RuboCop::Cop::AutoCorrector
739
-
740
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#62
741
- def factory_call(param0 = T.unsafe(nil)); end
742
-
743
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#69
744
- def on_send(node); end
745
-
746
- private
747
-
748
- # @return [Boolean]
749
- #
750
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#89
751
- def namespaced?(name); end
752
-
753
- # @return [Boolean]
754
- #
755
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#85
756
- def offense_for_string_style?(name); end
757
-
758
- # @return [Boolean]
759
- #
760
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#81
761
- def offense_for_symbol_style?(name); end
762
-
763
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#93
764
- def register_offense(name, prefer); end
765
- end
766
-
767
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#58
768
- RuboCop::Cop::FactoryBot::FactoryNameStyle::FACTORY_CALLS = T.let(T.unsafe(nil), Set)
769
-
770
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#57
771
- RuboCop::Cop::FactoryBot::FactoryNameStyle::MSG = T.let(T.unsafe(nil), String)
772
-
773
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/factory_name_style.rb#59
774
- RuboCop::Cop::FactoryBot::FactoryNameStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
775
-
776
- # Do not create a FactoryBot sequence for an id column.
777
- #
778
- # @example
779
- # # bad - can lead to conflicts between FactoryBot and DB sequences
780
- # factory :foo do
781
- # sequence :id
782
- # end
783
- #
784
- # # good - a non-id column
785
- # factory :foo do
786
- # sequence :some_non_id_column
787
- # end
788
- #
789
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/id_sequence.rb#19
790
- class RuboCop::Cop::FactoryBot::IdSequence < ::RuboCop::Cop::Base
791
- include ::RuboCop::Cop::RangeHelp
792
- include ::RuboCop::FactoryBot::Language
793
- extend ::RuboCop::Cop::AutoCorrector
794
-
795
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/id_sequence.rb#27
796
- def on_send(node); end
797
- end
798
-
799
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/id_sequence.rb#24
800
- RuboCop::Cop::FactoryBot::IdSequence::MSG = T.let(T.unsafe(nil), String)
801
-
802
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/id_sequence.rb#25
803
- RuboCop::Cop::FactoryBot::IdSequence::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
804
-
805
- # Checks for redundant `factory` option.
806
- #
807
- # @example
808
- # # bad
809
- # association :user, factory: :user
810
- #
811
- # # good
812
- # association :user
813
- #
814
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#14
815
- class RuboCop::Cop::FactoryBot::RedundantFactoryOption < ::RuboCop::Cop::Base
816
- include ::RuboCop::Cop::RangeHelp
817
- extend ::RuboCop::Cop::AutoCorrector
818
-
819
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#24
820
- def association_with_a_factory_option(param0 = T.unsafe(nil)); end
821
-
822
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#42
823
- def on_send(node); end
824
-
825
- private
826
-
827
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#55
828
- def autocorrect(corrector, node); end
829
- end
830
-
831
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#19
832
- RuboCop::Cop::FactoryBot::RedundantFactoryOption::MSG = T.let(T.unsafe(nil), String)
833
-
834
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/redundant_factory_option.rb#21
835
- RuboCop::Cop::FactoryBot::RedundantFactoryOption::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
836
-
837
- # Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
838
- #
839
- # @example
840
- # # bad
841
- # FactoryBot.create(:bar)
842
- # FactoryBot.build(:bar)
843
- # FactoryBot.attributes_for(:bar)
844
- #
845
- # # good
846
- # create(:bar)
847
- # build(:bar)
848
- # attributes_for(:bar)
849
- #
850
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#48
851
- class RuboCop::Cop::FactoryBot::SyntaxMethods < ::RuboCop::Cop::Base
852
- include ::RuboCop::Cop::RangeHelp
853
- include ::RuboCop::FactoryBot::Language
854
- extend ::RuboCop::Cop::AutoCorrector
855
-
856
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#73
857
- def on_send(node); end
858
-
859
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#58
860
- def spec_group?(param0 = T.unsafe(nil)); end
861
-
862
- private
863
-
864
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#87
865
- def crime_scene(node); end
866
-
867
- # @return [Boolean]
868
- #
869
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#109
870
- def example_group_root?(node); end
871
-
872
- # @return [Boolean]
873
- #
874
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#113
875
- def example_group_root_with_siblings?(node); end
876
-
877
- # @return [Boolean]
878
- #
879
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#101
880
- def inside_example_group?(node); end
881
-
882
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#94
883
- def offense(node); end
884
- end
885
-
886
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#53
887
- RuboCop::Cop::FactoryBot::SyntaxMethods::MSG = T.let(T.unsafe(nil), String)
888
-
889
- # source://rubocop-factory_bot//lib/rubocop/cop/factory_bot/syntax_methods.rb#55
890
- RuboCop::Cop::FactoryBot::SyntaxMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
891
-
892
- # RuboCop factory_bot project namespace
893
- #
894
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#5
895
- module RuboCop::FactoryBot
896
- class << self
897
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#54
898
- def attribute_defining_methods; end
899
-
900
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#58
901
- def reserved_methods; end
902
- end
903
- end
904
-
905
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#6
906
- RuboCop::FactoryBot::ATTRIBUTE_DEFINING_METHODS = T.let(T.unsafe(nil), Array)
907
-
908
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#29
909
- RuboCop::FactoryBot::DEFINITION_PROXY_METHODS = T.let(T.unsafe(nil), Array)
910
-
911
- # Contains node matchers for common factory_bot DSL.
912
- #
913
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/language.rb#6
914
- module RuboCop::FactoryBot::Language
915
- extend ::RuboCop::AST::NodePattern::Macros
916
-
917
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/language.rb#30
918
- def factory_bot?(param0 = T.unsafe(nil)); end
919
- end
920
-
921
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/language.rb#9
922
- RuboCop::FactoryBot::Language::METHODS = T.let(T.unsafe(nil), Set)
923
-
924
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#42
925
- RuboCop::FactoryBot::RESERVED_METHODS = T.let(T.unsafe(nil), Array)
926
-
927
- # source://rubocop-factory_bot//lib/rubocop/factory_bot/factory_bot.rb#14
928
- RuboCop::FactoryBot::UNPROXIED_METHODS = T.let(T.unsafe(nil), Array)