steep 0.40.0 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/bin/output_rebaseline.rb +15 -30
  4. data/bin/output_test.rb +17 -57
  5. data/lib/steep.rb +4 -0
  6. data/lib/steep/cli.rb +9 -3
  7. data/lib/steep/drivers/check.rb +106 -14
  8. data/lib/steep/drivers/diagnostic_printer.rb +11 -11
  9. data/lib/steep/expectations.rb +159 -0
  10. data/lib/steep/project.rb +6 -0
  11. data/lib/steep/version.rb +1 -1
  12. data/smoke/alias/test_expectations.yml +96 -0
  13. data/smoke/and/test_expectations.yml +31 -0
  14. data/smoke/array/test_expectations.yml +103 -0
  15. data/smoke/block/test_expectations.yml +125 -0
  16. data/smoke/case/test_expectations.yml +47 -0
  17. data/smoke/class/test_expectations.yml +120 -0
  18. data/smoke/const/test_expectations.yml +139 -0
  19. data/smoke/diagnostics-rbs-duplicated/test_expectations.yml +13 -0
  20. data/smoke/diagnostics-rbs/test_expectations.yml +229 -0
  21. data/smoke/diagnostics/test_expectations.yml +477 -0
  22. data/smoke/dstr/test_expectations.yml +13 -0
  23. data/smoke/ensure/test_expectations.yml +62 -0
  24. data/smoke/enumerator/test_expectations.yml +135 -0
  25. data/smoke/extension/test_expectations.yml +61 -0
  26. data/smoke/hash/test_expectations.yml +81 -0
  27. data/smoke/hello/test_expectations.yml +25 -0
  28. data/smoke/if/test_expectations.yml +34 -0
  29. data/smoke/implements/test_expectations.yml +23 -0
  30. data/smoke/initialize/test_expectations.yml +1 -0
  31. data/smoke/integer/test_expectations.yml +101 -0
  32. data/smoke/interface/test_expectations.yml +23 -0
  33. data/smoke/kwbegin/test_expectations.yml +17 -0
  34. data/smoke/lambda/test_expectations.yml +39 -0
  35. data/smoke/literal/test_expectations.yml +106 -0
  36. data/smoke/map/test_expectations.yml +1 -0
  37. data/smoke/method/test_expectations.yml +90 -0
  38. data/smoke/module/test_expectations.yml +75 -0
  39. data/smoke/regexp/test_expectations.yml +615 -0
  40. data/smoke/regression/test_expectations.yml +43 -0
  41. data/smoke/rescue/test_expectations.yml +79 -0
  42. data/smoke/self/test_expectations.yml +23 -0
  43. data/smoke/skip/test_expectations.yml +23 -0
  44. data/smoke/stdout/test_expectations.yml +1 -0
  45. data/smoke/super/test_expectations.yml +79 -0
  46. data/smoke/toplevel/test_expectations.yml +15 -0
  47. data/smoke/tsort/test_expectations.yml +43 -0
  48. data/smoke/type_case/test_expectations.yml +48 -0
  49. data/smoke/yield/test_expectations.yml +68 -0
  50. metadata +41 -44
  51. data/smoke/alias/test.yaml +0 -73
  52. data/smoke/and/test.yaml +0 -24
  53. data/smoke/array/test.yaml +0 -80
  54. data/smoke/block/test.yaml +0 -96
  55. data/smoke/broken/Steepfile +0 -5
  56. data/smoke/broken/broken.rb +0 -0
  57. data/smoke/broken/broken.rbs +0 -0
  58. data/smoke/broken/test.yaml +0 -6
  59. data/smoke/case/test.yaml +0 -36
  60. data/smoke/class/test.yaml +0 -89
  61. data/smoke/const/test.yaml +0 -96
  62. data/smoke/diagnostics-rbs-duplicated/test.yaml +0 -10
  63. data/smoke/diagnostics-rbs/test.yaml +0 -142
  64. data/smoke/diagnostics/test.yaml +0 -333
  65. data/smoke/dstr/test.yaml +0 -10
  66. data/smoke/ensure/test.yaml +0 -47
  67. data/smoke/enumerator/test.yaml +0 -100
  68. data/smoke/extension/test.yaml +0 -50
  69. data/smoke/hash/test.yaml +0 -62
  70. data/smoke/hello/test.yaml +0 -18
  71. data/smoke/if/test.yaml +0 -27
  72. data/smoke/implements/test.yaml +0 -16
  73. data/smoke/initialize/test.yaml +0 -4
  74. data/smoke/integer/test.yaml +0 -66
  75. data/smoke/interface/test.yaml +0 -16
  76. data/smoke/kwbegin/test.yaml +0 -14
  77. data/smoke/lambda/test.yaml +0 -28
  78. data/smoke/literal/test.yaml +0 -79
  79. data/smoke/map/test.yaml +0 -4
  80. data/smoke/method/test.yaml +0 -71
  81. data/smoke/module/test.yaml +0 -51
  82. data/smoke/regexp/test.yaml +0 -372
  83. data/smoke/regression/test.yaml +0 -38
  84. data/smoke/rescue/test.yaml +0 -60
  85. data/smoke/self/test.yaml +0 -16
  86. data/smoke/skip/test.yaml +0 -16
  87. data/smoke/stdout/test.yaml +0 -4
  88. data/smoke/super/test.yaml +0 -52
  89. data/smoke/toplevel/test.yaml +0 -12
  90. data/smoke/tsort/test.yaml +0 -32
  91. data/smoke/type_case/test.yaml +0 -33
  92. data/smoke/yield/test.yaml +0 -49
@@ -0,0 +1,477 @@
1
+ ---
2
+ - file: argument_type_mismatch.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 1
7
+ character: 9
8
+ end:
9
+ line: 1
10
+ character: 11
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot pass a value of type `::String` as an argument of type `::int`
14
+ ::String <: ::int
15
+ ::String <: (::Integer | ::_ToInt)
16
+ ::String <: ::Integer
17
+ ::Object <: ::Integer
18
+ ::BasicObject <: ::Integer
19
+ code: Ruby::ArgumentTypeMismatch
20
+ - file: block_body_type_mismatch.rb
21
+ diagnostics:
22
+ - range:
23
+ start:
24
+ line: 1
25
+ character: 30
26
+ end:
27
+ line: 1
28
+ character: 36
29
+ severity: ERROR
30
+ message: |-
31
+ Cannot allow block body have type `::String` because declared as type `::Integer`
32
+ ::String <: ::Integer
33
+ ::Object <: ::Integer
34
+ ::BasicObject <: ::Integer
35
+ code: Ruby::BlockBodyTypeMismatch
36
+ - file: block_type_mismatch.rb
37
+ diagnostics:
38
+ - range:
39
+ start:
40
+ line: 3
41
+ character: 8
42
+ end:
43
+ line: 3
44
+ character: 12
45
+ severity: ERROR
46
+ message: |-
47
+ Cannot pass a value of type `^(untyped, untyped, untyped) -> untyped` as a block-pass-argument of type `^(::Integer) -> void`
48
+ ^(untyped, untyped, untyped) -> untyped <: ^(::Integer) -> void
49
+ code: Ruby::BlockTypeMismatch
50
+ - file: break_type_mismatch.rb
51
+ diagnostics:
52
+ - range:
53
+ start:
54
+ line: 1
55
+ character: 10
56
+ end:
57
+ line: 1
58
+ character: 18
59
+ severity: ERROR
60
+ message: |-
61
+ Cannot break with a value of type `::String` because type `::Integer` is assumed
62
+ ::String <: ::Integer
63
+ ::Object <: ::Integer
64
+ ::BasicObject <: ::Integer
65
+ code: Ruby::BreakTypeMismatch
66
+ - file: else_on_exhaustive_case.rb
67
+ diagnostics:
68
+ - range:
69
+ start:
70
+ line: 11
71
+ character: 2
72
+ end:
73
+ line: 11
74
+ character: 26
75
+ severity: ERROR
76
+ message: The branch is unreachable because the condition is exhaustive
77
+ code: Ruby::ElseOnExhaustiveCase
78
+ - file: incompatible_annotation.rb
79
+ diagnostics:
80
+ - range:
81
+ start:
82
+ line: 5
83
+ character: 2
84
+ end:
85
+ line: 5
86
+ character: 8
87
+ severity: ERROR
88
+ message: |-
89
+ Type annotation about `a` is incompatible since ::String <: ::Array[::Integer] doesn't hold
90
+ ::String <: ::Array[::Integer]
91
+ ::Object <: ::Array[::Integer]
92
+ ::BasicObject <: ::Array[::Integer]
93
+ code: Ruby::IncompatibleAnnotation
94
+ - file: incompatible_argument.rb
95
+ diagnostics:
96
+ - range:
97
+ start:
98
+ line: 1
99
+ character: 6
100
+ end:
101
+ line: 1
102
+ character: 8
103
+ severity: ERROR
104
+ message: |-
105
+ Cannot find method `at` of type `::Array[::Integer]` with compatible arity
106
+ Method types:
107
+ def at: (::int) -> (::Integer | nil)
108
+ code: Ruby::IncompatibleArguments
109
+ - file: incompatible_assignment.rb
110
+ diagnostics:
111
+ - range:
112
+ start:
113
+ line: 2
114
+ character: 0
115
+ end:
116
+ line: 2
117
+ character: 5
118
+ severity: ERROR
119
+ message: |-
120
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
121
+ ::Integer <: ::String
122
+ ::Numeric <: ::String
123
+ ::Object <: ::String
124
+ ::BasicObject <: ::String
125
+ code: Ruby::IncompatibleAssignment
126
+ - range:
127
+ start:
128
+ line: 5
129
+ character: 0
130
+ end:
131
+ line: 5
132
+ character: 7
133
+ severity: ERROR
134
+ message: |-
135
+ Cannot assign a value of type `::Integer` to a constant of type `::String`
136
+ ::Integer <: ::String
137
+ ::Numeric <: ::String
138
+ ::Object <: ::String
139
+ ::BasicObject <: ::String
140
+ code: Ruby::IncompatibleAssignment
141
+ - range:
142
+ start:
143
+ line: 8
144
+ character: 0
145
+ end:
146
+ line: 8
147
+ character: 9
148
+ severity: ERROR
149
+ message: |-
150
+ Cannot assign a value of type `::Symbol` to a variable of type `::Integer`
151
+ ::Symbol <: ::Integer
152
+ ::Object <: ::Integer
153
+ ::BasicObject <: ::Integer
154
+ code: Ruby::IncompatibleAssignment
155
+ - file: method_arity_mismatch.rb
156
+ diagnostics:
157
+ - range:
158
+ start:
159
+ line: 3
160
+ character: 9
161
+ end:
162
+ line: 3
163
+ character: 12
164
+ severity: ERROR
165
+ message: Method parameters are incompatible with declaration `() -> void`
166
+ code: Ruby::MethodArityMismatch
167
+ - range:
168
+ start:
169
+ line: 8
170
+ character: 11
171
+ end:
172
+ line: 8
173
+ character: 14
174
+ severity: ERROR
175
+ message: Method parameters are incompatible with declaration `(::String) -> void`
176
+ code: Ruby::MethodArityMismatch
177
+ - file: method_body_type_mismatch.rb
178
+ diagnostics:
179
+ - range:
180
+ start:
181
+ line: 3
182
+ character: 2
183
+ end:
184
+ line: 5
185
+ character: 5
186
+ severity: ERROR
187
+ message: |-
188
+ Cannot allow method body have type `::String` because declared as type `::Integer`
189
+ ::String <: ::Integer
190
+ ::Object <: ::Integer
191
+ ::BasicObject <: ::Integer
192
+ code: Ruby::MethodBodyTypeMismatch
193
+ - file: method_definition_missing.rb
194
+ diagnostics:
195
+ - range:
196
+ start:
197
+ line: 1
198
+ character: 6
199
+ end:
200
+ line: 1
201
+ character: 29
202
+ severity: ERROR
203
+ message: Cannot find implementation of method `::MethodDefinitionMissing#foo`
204
+ code: Ruby::MethodDefinitionMissing
205
+ - file: method_return_type_annotation_mismatch.rb
206
+ diagnostics:
207
+ - range:
208
+ start:
209
+ line: 3
210
+ character: 2
211
+ end:
212
+ line: 6
213
+ character: 5
214
+ severity: ERROR
215
+ message: |-
216
+ Annotation `@type return` specifies type `::Integer` where declared as type `::String`
217
+ ::Integer <: ::String
218
+ ::Numeric <: ::String
219
+ ::Object <: ::String
220
+ ::BasicObject <: ::String
221
+ code: Ruby::MethodReturnTypeAnnotationMismatch
222
+ - file: missing_keyword.rb
223
+ diagnostics:
224
+ - range:
225
+ start:
226
+ line: 1
227
+ character: 23
228
+ end:
229
+ line: 1
230
+ character: 32
231
+ severity: ERROR
232
+ message: 'Cannot omit required keywords: `foo`'
233
+ code: Ruby::MissingKeyword
234
+ - file: no_method.rb
235
+ diagnostics:
236
+ - range:
237
+ start:
238
+ line: 1
239
+ character: 2
240
+ end:
241
+ line: 1
242
+ character: 5
243
+ severity: ERROR
244
+ message: Type `::Integer` does not have method `foo`
245
+ code: Ruby::NoMethod
246
+ - file: required_block_missing.rb
247
+ diagnostics:
248
+ - range:
249
+ start:
250
+ line: 1
251
+ character: 4
252
+ end:
253
+ line: 1
254
+ character: 7
255
+ severity: ERROR
256
+ message: The method cannot be called without a block
257
+ code: Ruby::RequiredBlockMissing
258
+ - file: return_type_mismatch.rb
259
+ diagnostics:
260
+ - range:
261
+ start:
262
+ line: 4
263
+ character: 4
264
+ end:
265
+ line: 4
266
+ character: 13
267
+ severity: ERROR
268
+ message: |-
269
+ The method cannot return a value of type `::Integer` because declared as type `::String`
270
+ ::Integer <: ::String
271
+ ::Numeric <: ::String
272
+ ::Object <: ::String
273
+ ::BasicObject <: ::String
274
+ code: Ruby::ReturnTypeMismatch
275
+ - file: unexpected_block_given.rb
276
+ diagnostics:
277
+ - range:
278
+ start:
279
+ line: 1
280
+ character: 10
281
+ end:
282
+ line: 1
283
+ character: 17
284
+ severity: ERROR
285
+ message: The method cannot be called with a block
286
+ code: Ruby::UnexpectedBlockGiven
287
+ - file: unexpected_dynamic_method.rb
288
+ diagnostics:
289
+ - range:
290
+ start:
291
+ line: 1
292
+ character: 6
293
+ end:
294
+ line: 1
295
+ character: 29
296
+ severity: ERROR
297
+ message: "@dynamic annotation contains unknown method name `foo`"
298
+ code: Ruby::UnexpectedDynamicMethod
299
+ - file: unexpected_jump.rb
300
+ diagnostics:
301
+ - range:
302
+ start:
303
+ line: 1
304
+ character: 0
305
+ end:
306
+ line: 1
307
+ character: 5
308
+ severity: ERROR
309
+ message: Cannot jump from here
310
+ code: Ruby::UnexpectedJump
311
+ - range:
312
+ start:
313
+ line: 3
314
+ character: 0
315
+ end:
316
+ line: 3
317
+ character: 4
318
+ severity: ERROR
319
+ message: Cannot jump from here
320
+ code: Ruby::UnexpectedJump
321
+ - file: unexpected_jump_value.rb
322
+ diagnostics:
323
+ - range:
324
+ start:
325
+ line: 2
326
+ character: 2
327
+ end:
328
+ line: 2
329
+ character: 10
330
+ severity: ERROR
331
+ message: The value given to break will be ignored
332
+ code: Ruby::UnexpectedJumpValue
333
+ - file: unexpected_keyword.rb
334
+ diagnostics:
335
+ - range:
336
+ start:
337
+ line: 1
338
+ character: 26
339
+ end:
340
+ line: 1
341
+ character: 45
342
+ severity: ERROR
343
+ message: 'Cannot specify unexpected keyword arguments: `bar`'
344
+ code: Ruby::UnexpectedKeyword
345
+ - file: unexpected_splat.rb
346
+ diagnostics:
347
+ - range:
348
+ start:
349
+ line: 1
350
+ character: 13
351
+ end:
352
+ line: 1
353
+ character: 18
354
+ severity: ERROR
355
+ message: Hash splat is given with object other than `Hash[X, Y]`
356
+ code: Ruby::UnexpectedSplat
357
+ - file: unexpected_yield.rb
358
+ diagnostics:
359
+ - range:
360
+ start:
361
+ line: 4
362
+ character: 4
363
+ end:
364
+ line: 4
365
+ character: 9
366
+ severity: ERROR
367
+ message: Cannot detect the type of the expression
368
+ code: Ruby::FallbackAny
369
+ - range:
370
+ start:
371
+ line: 4
372
+ character: 4
373
+ end:
374
+ line: 4
375
+ character: 9
376
+ severity: ERROR
377
+ message: No block given for `yield`
378
+ code: Ruby::UnexpectedYield
379
+ - file: unknown_constant_assigned.rb
380
+ diagnostics:
381
+ - range:
382
+ start:
383
+ line: 2
384
+ character: 2
385
+ end:
386
+ line: 2
387
+ character: 5
388
+ severity: ERROR
389
+ message: Cannot find the declaration of constant `FOO`
390
+ code: Ruby::UnknownConstantAssigned
391
+ - range:
392
+ start:
393
+ line: 4
394
+ character: 2
395
+ end:
396
+ line: 4
397
+ character: 5
398
+ severity: ERROR
399
+ message: Cannot detect the type of the expression
400
+ code: Ruby::FallbackAny
401
+ - range:
402
+ start:
403
+ line: 4
404
+ character: 2
405
+ end:
406
+ line: 4
407
+ character: 10
408
+ severity: ERROR
409
+ message: Cannot find the declaration of constant `FOO::BAR`
410
+ code: Ruby::UnknownConstantAssigned
411
+ - range:
412
+ start:
413
+ line: 6
414
+ character: 2
415
+ end:
416
+ line: 6
417
+ character: 7
418
+ severity: ERROR
419
+ message: Cannot find the declaration of constant `::FOO`
420
+ code: Ruby::UnknownConstantAssigned
421
+ - file: unresolved_overloading.rb
422
+ diagnostics:
423
+ - range:
424
+ start:
425
+ line: 1
426
+ character: 0
427
+ end:
428
+ line: 1
429
+ character: 6
430
+ severity: ERROR
431
+ message: |-
432
+ Cannot find compatible overloading of method `+` of type `::Integer`
433
+ Method types:
434
+ def +: (::Integer) -> ::Integer
435
+ | (::Float) -> ::Float
436
+ | (::Rational) -> ::Rational
437
+ | (::Complex) -> ::Complex
438
+ code: Ruby::UnresolvedOverloading
439
+ - file: unsatisfiable_constraint.rb
440
+ diagnostics:
441
+ - range:
442
+ start:
443
+ line: 4
444
+ character: 0
445
+ end:
446
+ line: 7
447
+ character: 3
448
+ severity: ERROR
449
+ message: |-
450
+ Unsatisfiable constraint `::Array[untyped] <: A(1) <: ::String` is generated through (A(1)) { (A(1)) -> void } -> B(2)
451
+ ::Array[untyped] <: ::String
452
+ ::Object <: ::String
453
+ ::BasicObject <: ::String
454
+ code: Ruby::UnsatisfiableConstraint
455
+ - range:
456
+ start:
457
+ line: 6
458
+ character: 4
459
+ end:
460
+ line: 6
461
+ character: 7
462
+ severity: ERROR
463
+ message: Type `::String` does not have method `foo`
464
+ code: Ruby::NoMethod
465
+ - file: unsupported_syntax.rb
466
+ diagnostics:
467
+ - range:
468
+ start:
469
+ line: 1
470
+ character: 0
471
+ end:
472
+ line: 2
473
+ character: 3
474
+ severity: ERROR
475
+ message: sclass receiver must be instance type or singleton type, but type given
476
+ `(::Integer | ::String | nil)`
477
+ code: Ruby::UnsupportedSyntax