reform 2.3.0.rc2 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +17 -0
  3. data/.gitignore +4 -2
  4. data/CHANGES.md +24 -1
  5. data/Gemfile +1 -7
  6. data/LICENSE.txt +1 -1
  7. data/README.md +5 -5
  8. data/Rakefile +2 -15
  9. data/lib/reform/contract/validate.rb +1 -1
  10. data/lib/reform/form/dry.rb +47 -9
  11. data/lib/reform/form/populator.rb +13 -3
  12. data/lib/reform/form/prepopulate.rb +1 -1
  13. data/lib/reform/form/validate.rb +3 -3
  14. data/lib/reform/validation/groups.rb +0 -1
  15. data/lib/reform/version.rb +1 -1
  16. data/reform.gemspec +3 -4
  17. data/test/call_test.rb +23 -0
  18. data/test/changed_test.rb +6 -6
  19. data/test/coercion_test.rb +17 -17
  20. data/test/{composition_new_api.rb → composition_test.rb} +27 -28
  21. data/test/{contract_new_api.rb → contract_test.rb} +8 -8
  22. data/test/default_test.rb +2 -2
  23. data/test/deserialize_test.rb +8 -8
  24. data/test/docs/validation_test.rb +134 -0
  25. data/test/{errors_new_api.rb → errors_test.rb} +41 -41
  26. data/test/feature_test.rb +2 -2
  27. data/test/fixtures/dry_error_messages.yml +64 -54
  28. data/test/{form_option_new_api.rb → form_option_test.rb} +1 -1
  29. data/test/{form_new_api.rb → form_test.rb} +3 -3
  30. data/test/from_test.rb +10 -10
  31. data/test/{inherit_new_api.rb → inherit_test.rb} +17 -17
  32. data/test/{module_new_api.rb → module_test.rb} +10 -10
  33. data/test/parse_option_test.rb +7 -7
  34. data/test/parse_pipeline_test.rb +1 -1
  35. data/test/{populate_new_api.rb → populate_test.rb} +136 -53
  36. data/test/populator_skip_test.rb +2 -2
  37. data/test/prepopulator_test.rb +16 -16
  38. data/test/read_only_test.rb +2 -2
  39. data/test/readable_test.rb +3 -3
  40. data/test/{reform_new_api.rb → reform_test.rb} +19 -19
  41. data/test/{save_new_api.rb → save_test.rb} +4 -4
  42. data/test/setup_test.rb +9 -9
  43. data/test/{skip_if_new_api.rb → skip_if_test.rb} +12 -12
  44. data/test/skip_setter_and_getter_test.rb +6 -6
  45. data/test/test_helper.rb +6 -7
  46. data/test/{validate_new_api.rb → validate_test.rb} +108 -76
  47. data/test/validation/{dry_validation_new_api.rb → dry_validation_test.rb} +145 -135
  48. data/test/validation/result_test.rb +14 -14
  49. data/test/virtual_test.rb +7 -7
  50. data/test/writeable_test.rb +8 -8
  51. metadata +46 -99
  52. data/.rubocop.yml +0 -30
  53. data/.rubocop_todo.yml +0 -460
  54. data/.travis.yml +0 -32
  55. data/lib/reform/form/dry/new_api.rb +0 -58
  56. data/lib/reform/form/dry/old_api.rb +0 -61
  57. data/test/call_new_api.rb +0 -23
  58. data/test/call_old_api.rb +0 -23
  59. data/test/composition_old_api.rb +0 -184
  60. data/test/contract_old_api.rb +0 -77
  61. data/test/errors_old_api.rb +0 -230
  62. data/test/fixtures/dry_new_api_error_messages.yml +0 -104
  63. data/test/form_old_api.rb +0 -57
  64. data/test/form_option_old_api.rb +0 -24
  65. data/test/inherit_old_api.rb +0 -105
  66. data/test/module_old_api.rb +0 -146
  67. data/test/populate_old_api.rb +0 -304
  68. data/test/reform_old_api.rb +0 -202
  69. data/test/save_old_api.rb +0 -101
  70. data/test/skip_if_old_api.rb +0 -92
  71. data/test/validate_old_api.rb +0 -410
  72. data/test/validation/dry_validation_old_api.rb +0 -772
data/.rubocop_todo.yml DELETED
@@ -1,460 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2019-08-18 11:55:38 +1000 using RuboCop version 0.74.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, Include.
12
- # Include: **/*.gemspec
13
- Gemspec/OrderedDependencies:
14
- Exclude:
15
- - 'reform.gemspec'
16
-
17
- # Offense count: 1
18
- # Cop supports --auto-correct.
19
- # Configuration parameters: EnforcedStyle, IndentationWidth.
20
- # SupportedStyles: outdent, indent
21
- Layout/AccessModifierIndentation:
22
- Exclude:
23
- - 'test/populate_test.rb'
24
-
25
- # Offense count: 6
26
- # Cop supports --auto-correct.
27
- # Configuration parameters: EnforcedStyle, IndentationWidth.
28
- # SupportedStyles: with_first_argument, with_fixed_indentation
29
- Layout/AlignArguments:
30
- Exclude:
31
- - 'test/deserialize_test.rb'
32
- - 'test/populate_test.rb'
33
- - 'test/validate_test.rb'
34
-
35
- # Offense count: 4
36
- # Cop supports --auto-correct.
37
- Layout/AlignArray:
38
- Exclude:
39
- - 'test/populate_test.rb'
40
-
41
- # Offense count: 56
42
- # Cop supports --auto-correct.
43
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
44
- # SupportedHashRocketStyles: key, separator, table
45
- # SupportedColonStyles: key, separator, table
46
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
47
- Layout/AlignHash:
48
- Exclude:
49
- - 'test/coercion_test.rb'
50
- - 'test/composition_test.rb'
51
- - 'test/errors_test.rb'
52
- - 'test/populate_test.rb'
53
- - 'test/validate_test.rb'
54
- - 'test/validation/dry_validation_test.rb'
55
- - 'test/validation/result_test.rb'
56
-
57
- # Offense count: 2
58
- # Cop supports --auto-correct.
59
- # Configuration parameters: EnforcedStyleAlignWith.
60
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
61
- Layout/BlockAlignment:
62
- Exclude:
63
- - 'lib/reform/errors.rb'
64
- - 'test/from_test.rb'
65
-
66
- # Offense count: 2
67
- # Cop supports --auto-correct.
68
- Layout/BlockEndNewline:
69
- Exclude:
70
- - 'test/populate_test.rb'
71
- - 'test/validate_test.rb'
72
-
73
- # Offense count: 1
74
- # Cop supports --auto-correct.
75
- Layout/ClosingParenthesisIndentation:
76
- Exclude:
77
- - 'test/composition_test.rb'
78
-
79
- # Offense count: 7
80
- # Cop supports --auto-correct.
81
- Layout/EmptyLineAfterGuardClause:
82
- Exclude:
83
- - 'lib/reform/form/populator.rb'
84
- - 'lib/reform/form/prepopulate.rb'
85
- - 'lib/reform/validation/groups.rb'
86
- - 'test/populator_skip_test.rb'
87
-
88
- # Offense count: 1
89
- # Cop supports --auto-correct.
90
- Layout/EmptyLineAfterMagicComment:
91
- Exclude:
92
- - 'test/validation/dry_validation_test.rb'
93
-
94
- # Offense count: 3
95
- # Cop supports --auto-correct.
96
- # Configuration parameters: EnforcedStyle.
97
- # SupportedStyles: around, only_before
98
- Layout/EmptyLinesAroundAccessModifier:
99
- Exclude:
100
- - 'test/populate_test.rb'
101
- - 'test/prepopulator_test.rb'
102
-
103
- # Offense count: 10
104
- # Cop supports --auto-correct.
105
- # Configuration parameters: EnforcedStyle.
106
- # SupportedStyles: empty_lines, no_empty_lines
107
- Layout/EmptyLinesAroundBlockBody:
108
- Exclude:
109
- - 'test/from_test.rb'
110
- - 'test/inherit_test.rb'
111
- - 'test/populate_test.rb'
112
- - 'test/validate_test.rb'
113
- - 'test/validation/dry_validation_test.rb'
114
-
115
- # Offense count: 3
116
- # Cop supports --auto-correct.
117
- # Configuration parameters: EnforcedStyle.
118
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
119
- Layout/EmptyLinesAroundClassBody:
120
- Exclude:
121
- - 'test/skip_if_test.rb'
122
- - 'test/validation/dry_validation_test.rb'
123
-
124
- # Offense count: 8
125
- # Cop supports --auto-correct.
126
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
127
- Layout/ExtraSpacing:
128
- Exclude:
129
- - 'test/benchmarking.rb'
130
- - 'test/composition_test.rb'
131
- - 'test/populate_test.rb'
132
- - 'test/prepopulator_test.rb'
133
- - 'test/validation/dry_validation_test.rb'
134
-
135
- # Offense count: 2
136
- # Cop supports --auto-correct.
137
- Layout/FirstArrayElementLineBreak:
138
- Exclude:
139
- - 'test/populate_test.rb'
140
-
141
- # Offense count: 3
142
- # Cop supports --auto-correct.
143
- Layout/FirstHashElementLineBreak:
144
- Exclude:
145
- - 'test/validate_test.rb'
146
- - 'test/validation/dry_validation_test.rb'
147
- - 'test/validation/result_test.rb'
148
-
149
- # Offense count: 4
150
- # Cop supports --auto-correct.
151
- Layout/FirstMethodArgumentLineBreak:
152
- Exclude:
153
- - 'test/deserialize_test.rb'
154
- - 'test/validation/dry_validation_test.rb'
155
-
156
- # Offense count: 1
157
- # Cop supports --auto-correct.
158
- # Configuration parameters: EnforcedStyle.
159
- # SupportedStyles: normal, indented_internal_methods
160
- Layout/IndentationConsistency:
161
- Exclude:
162
- - 'test/benchmarking.rb'
163
-
164
- # Offense count: 5
165
- # Cop supports --auto-correct.
166
- # Configuration parameters: Width, IgnoredPatterns.
167
- Layout/IndentationWidth:
168
- Exclude:
169
- - 'lib/reform/errors.rb'
170
- - 'test/benchmarking.rb'
171
- - 'test/prepopulator_test.rb'
172
-
173
- # Offense count: 4
174
- # Cop supports --auto-correct.
175
- # Configuration parameters: AllowDoxygenCommentStyle.
176
- Layout/LeadingCommentSpace:
177
- Exclude:
178
- - 'test/docs/**/*'
179
- - 'test/benchmarking.rb'
180
-
181
- # Offense count: 1
182
- # Cop supports --auto-correct.
183
- # Configuration parameters: EnforcedStyle.
184
- # SupportedStyles: symmetrical, new_line, same_line
185
- Layout/MultilineHashBraceLayout:
186
- Exclude:
187
- - 'test/validation/result_test.rb'
188
-
189
- # Offense count: 3
190
- # Cop supports --auto-correct.
191
- # Configuration parameters: EnforcedStyle.
192
- # SupportedStyles: symmetrical, new_line, same_line
193
- Layout/MultilineMethodCallBraceLayout:
194
- Exclude:
195
- - 'test/composition_test.rb'
196
- - 'test/deserialize_test.rb'
197
-
198
- # Offense count: 1
199
- # Cop supports --auto-correct.
200
- # Configuration parameters: EnforcedStyle, IndentationWidth.
201
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
202
- Layout/MultilineMethodCallIndentation:
203
- Exclude:
204
- - 'test/validation/dry_validation_test.rb'
205
-
206
- # Offense count: 3
207
- # Cop supports --auto-correct.
208
- # Configuration parameters: AllowForAlignment.
209
- Layout/SpaceAroundOperators:
210
- Exclude:
211
- - 'lib/reform/form.rb'
212
- - 'lib/reform/form/dry.rb'
213
-
214
- # Offense count: 3
215
- # Cop supports --auto-correct.
216
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
217
- # SupportedStyles: space, no_space, compact
218
- # SupportedStylesForEmptyBraces: space, no_space
219
- Layout/SpaceInsideHashLiteralBraces:
220
- Exclude:
221
- - 'Gemfile'
222
- - 'lib/reform/form.rb'
223
-
224
- # Offense count: 7
225
- # Cop supports --auto-correct.
226
- # Configuration parameters: IndentationWidth.
227
- Layout/Tab:
228
- Exclude:
229
- - 'lib/reform/errors.rb'
230
- - 'test/benchmarking.rb'
231
-
232
- # Offense count: 3
233
- Lint/IneffectiveAccessModifier:
234
- Exclude:
235
- - 'lib/reform/contract.rb'
236
- - 'lib/reform/form/validate.rb'
237
-
238
- # Offense count: 12
239
- # Cop supports --auto-correct.
240
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
241
- Lint/UnusedBlockArgument:
242
- Exclude:
243
- - 'lib/reform/errors.rb'
244
- - 'lib/reform/form.rb'
245
- - 'lib/reform/result.rb'
246
- - 'test/composition_test.rb'
247
- - 'test/parse_pipeline_test.rb'
248
- - 'test/populate_test.rb'
249
- - 'test/validate_test.rb'
250
- - 'test/validation/dry_validation_test.rb'
251
-
252
- # Offense count: 10
253
- # Cop supports --auto-correct.
254
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
255
- Lint/UnusedMethodArgument:
256
- Exclude:
257
- - 'lib/reform/contract/validate.rb'
258
- - 'lib/reform/errors.rb'
259
- - 'lib/reform/form/populator.rb'
260
- - 'lib/reform/form/validate.rb'
261
- - 'test/inherit_test.rb'
262
- - 'test/populate_test.rb'
263
- - 'test/prepopulator_test.rb'
264
-
265
- # Offense count: 2
266
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
267
- Lint/UselessAccessModifier:
268
- Exclude:
269
- - 'lib/reform/contract.rb'
270
- - 'test/populate_test.rb'
271
-
272
- # Offense count: 4
273
- Lint/UselessAssignment:
274
- Exclude:
275
- - 'lib/reform/form.rb'
276
- - 'lib/reform/form/dry.rb'
277
- - 'test/benchmarking.rb'
278
-
279
- # Offense count: 42
280
- # Cop supports --auto-correct.
281
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
282
- # URISchemes: http, https
283
- Metrics/LineLength:
284
- Max: 271
285
-
286
- # Offense count: 1
287
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
288
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
289
- Naming/MemoizedInstanceVariableName:
290
- Exclude:
291
- - 'lib/reform/validation.rb'
292
-
293
- # Offense count: 39
294
- # Cop supports --auto-correct.
295
- # Configuration parameters: EnforcedStyle.
296
- # SupportedStyles: braces, no_braces, context_dependent
297
- Style/BracesAroundHashParameters:
298
- Exclude:
299
- - 'test/call_test.rb'
300
- - 'test/composition_test.rb'
301
- - 'test/deserialize_test.rb'
302
- - 'test/from_test.rb'
303
- - 'test/module_test.rb'
304
- - 'test/reform_test.rb'
305
- - 'test/save_test.rb'
306
- - 'test/validation/dry_validation_test.rb'
307
- - 'test/validation/result_test.rb'
308
-
309
- # Offense count: 1
310
- # Cop supports --auto-correct.
311
- # Configuration parameters: Keywords.
312
- # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
313
- Style/CommentAnnotation:
314
- Exclude:
315
- - 'test/errors_test.rb'
316
-
317
- # Offense count: 9
318
- Style/CommentedKeyword:
319
- Exclude:
320
- - 'lib/reform/contract.rb'
321
- - 'lib/reform/form/populator.rb'
322
- - 'lib/reform/form/validate.rb'
323
- - 'lib/reform/result.rb'
324
- - 'test/module_test.rb'
325
- - 'test/reform_test.rb'
326
-
327
- # Offense count: 1
328
- # Cop supports --auto-correct.
329
- Style/Encoding:
330
- Exclude:
331
- - 'test/validation/dry_validation_test.rb'
332
-
333
- # Offense count: 1
334
- # Cop supports --auto-correct.
335
- Style/IfUnlessModifier:
336
- Exclude:
337
- - 'lib/reform/form.rb'
338
-
339
- # Offense count: 1
340
- Style/ImplicitRuntimeError:
341
- Exclude:
342
- - 'lib/reform/form/populator.rb'
343
-
344
- # Offense count: 1
345
- # Cop supports --auto-correct.
346
- Style/LineEndConcatenation:
347
- Exclude:
348
- - 'lib/reform/validation.rb'
349
-
350
- # Offense count: 1
351
- # Cop supports --auto-correct.
352
- # Configuration parameters: IgnoredMethods.
353
- Style/MethodCallWithoutArgsParentheses:
354
- Exclude:
355
- - 'test/reform_test.rb'
356
-
357
- # Offense count: 1
358
- Style/MethodMissingSuper:
359
- Exclude:
360
- - 'lib/reform/form/module.rb'
361
-
362
- # Offense count: 1
363
- # Configuration parameters: EnforcedStyle.
364
- # SupportedStyles: if, case, both
365
- Style/MissingElse:
366
- Exclude:
367
- - 'test/composition_test.rb'
368
-
369
- # Offense count: 1
370
- Style/MissingRespondToMissing:
371
- Exclude:
372
- - 'lib/reform/form/module.rb'
373
-
374
- # Offense count: 1
375
- # Cop supports --auto-correct.
376
- # Configuration parameters: EnforcedStyle.
377
- # SupportedStyles: predicate, comparison
378
- Style/NilComparison:
379
- Exclude:
380
- - 'test/prepopulator_test.rb'
381
-
382
- # Offense count: 2
383
- # Cop supports --auto-correct.
384
- # Configuration parameters: PreferredDelimiters.
385
- Style/PercentLiteralDelimiters:
386
- Exclude:
387
- - 'reform.gemspec'
388
- - 'test/validation/dry_validation_test.rb'
389
-
390
- # Offense count: 1
391
- # Cop supports --auto-correct.
392
- # Configuration parameters: EnforcedStyle.
393
- # SupportedStyles: compact, exploded
394
- Style/RaiseArgs:
395
- Exclude:
396
- - 'lib/reform/form.rb'
397
-
398
- # Offense count: 1
399
- # Cop supports --auto-correct.
400
- Style/RedundantParentheses:
401
- Exclude:
402
- - 'test/populate_test.rb'
403
-
404
- # Offense count: 1
405
- # Cop supports --auto-correct.
406
- Style/RedundantSelf:
407
- Exclude:
408
- - 'lib/reform/validation/groups.rb'
409
-
410
- # Offense count: 3
411
- # Cop supports --auto-correct.
412
- # Configuration parameters: EnforcedStyle.
413
- # SupportedStyles: only_raise, only_fail, semantic
414
- Style/SignalException:
415
- Exclude:
416
- - 'lib/reform/form.rb'
417
- - 'lib/reform/form/populator.rb'
418
- - 'lib/reform/validation.rb'
419
-
420
- # Offense count: 1
421
- # Cop supports --auto-correct.
422
- # Configuration parameters: EnforcedStyle.
423
- # SupportedStyles: use_perl_names, use_english_names
424
- Style/SpecialGlobalVars:
425
- Exclude:
426
- - 'reform.gemspec'
427
-
428
- # Offense count: 4
429
- # Cop supports --auto-correct.
430
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
431
- # SupportedStyles: single_quotes, double_quotes
432
- Style/StringLiterals:
433
- Exclude:
434
- - 'Gemfile'
435
-
436
- # Offense count: 1
437
- # Cop supports --auto-correct.
438
- # Configuration parameters: IgnoredMethods.
439
- # IgnoredMethods: respond_to, define_method
440
- Style/SymbolProc:
441
- Exclude:
442
- - 'lib/reform/errors.rb'
443
-
444
- # Offense count: 8
445
- # Cop supports --auto-correct.
446
- # Configuration parameters: EnforcedStyleForMultiline.
447
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
448
- Style/TrailingCommaInArguments:
449
- Exclude:
450
- - 'test/populate_test.rb'
451
- - 'test/validate_test.rb'
452
- - 'test/validation/dry_validation_test.rb'
453
-
454
- # Offense count: 1
455
- # Cop supports --auto-correct.
456
- # Configuration parameters: EnforcedStyleForMultiline.
457
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
458
- Style/TrailingCommaInHashLiteral:
459
- Exclude:
460
- - 'test/validation/result_test.rb'