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
@@ -1,38 +0,0 @@
1
- ---
2
- test:
3
- array.rb:
4
- diagnostics: []
5
- fun.rb:
6
- diagnostics: []
7
- hash.rb:
8
- diagnostics: []
9
- poly_new.rb:
10
- diagnostics: []
11
- range.rb:
12
- diagnostics: []
13
- set_divide.rb:
14
- diagnostics:
15
- - |
16
- set_divide.rb:2:2: [error] Type `::Set[::String]` does not have method `ffffffff`
17
- │ Diagnostic ID: Ruby::NoMethod
18
-
19
- └ d.ffffffff
20
- ~~~~~~~~
21
- - |
22
- set_divide.rb:5:4: [error] Type `::String` does not have method `ggggg`
23
- │ Diagnostic ID: Ruby::NoMethod
24
-
25
- └ x.ggggg
26
- ~~~~~
27
- - |
28
- set_divide.rb:7:4: [error] Type `::String` does not have method `ggggg`
29
- │ Diagnostic ID: Ruby::NoMethod
30
-
31
- └ y.ggggg
32
- ~~~~~
33
- - |
34
- set_divide.rb:11:4: [error] Type `::String` does not have method `ggggg`
35
- │ Diagnostic ID: Ruby::NoMethod
36
-
37
- └ x.ggggg
38
- ~~~~~
@@ -1,60 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:3:0: [error] Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::Integer`
7
- │ (::String | ::Integer) <: ::Integer
8
- │ ::String <: ::Integer
9
- │ ::Object <: ::Integer
10
- │ ::BasicObject <: ::Integer
11
-
12
- │ Diagnostic ID: Ruby::IncompatibleAssignment
13
-
14
- └ a = begin
15
- ~~~~~~~~~
16
- - |
17
- a.rb:11:0: [error] Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::Integer`
18
- │ (::String | ::Integer) <: ::Integer
19
- │ ::String <: ::Integer
20
- │ ::Object <: ::Integer
21
- │ ::BasicObject <: ::Integer
22
-
23
- │ Diagnostic ID: Ruby::IncompatibleAssignment
24
-
25
- └ b = 'foo' rescue 1
26
- ~~~~~~~~~~~~~~~~~~
27
- - |
28
- a.rb:15:0: [error] Cannot assign a value of type `(::String | ::Symbol | ::Integer)` to a variable of type `::Integer`
29
- │ (::String | ::Symbol | ::Integer) <: ::Integer
30
- │ ::String <: ::Integer
31
- │ ::Object <: ::Integer
32
- │ ::BasicObject <: ::Integer
33
-
34
- │ Diagnostic ID: Ruby::IncompatibleAssignment
35
-
36
- └ c = begin
37
- ~~~~~~~~~
38
- - |
39
- a.rb:25:0: [error] Cannot assign a value of type `(::Array[::Integer] | ::Symbol | ::Integer)` to a variable of type `::Integer`
40
- │ (::Array[::Integer] | ::Symbol | ::Integer) <: ::Integer
41
- │ ::Array[::Integer] <: ::Integer
42
- │ ::Object <: ::Integer
43
- │ ::BasicObject <: ::Integer
44
-
45
- │ Diagnostic ID: Ruby::IncompatibleAssignment
46
-
47
- └ e = begin
48
- ~~~~~~~~~
49
- - |
50
- a.rb:37:0: [error] Cannot allow method body have type `(::Integer | ::String)` because declared as type `::String`
51
- │ (::Integer | ::String) <: ::String
52
- │ ::Integer <: ::String
53
- │ ::Numeric <: ::String
54
- │ ::Object <: ::String
55
- │ ::BasicObject <: ::String
56
-
57
- │ Diagnostic ID: Ruby::MethodBodyTypeMismatch
58
-
59
- └ def foo(a)
60
- ~~~~~~~~~~
data/smoke/self/test.yaml DELETED
@@ -1,16 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:16:2: [error] Type `::Object` does not have method `baz`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ baz
10
- ~~~
11
- - |
12
- a.rb:19:4: [error] Type `::Object` does not have method `baz`
13
- │ Diagnostic ID: Ruby::NoMethod
14
-
15
- └ baz
16
- ~~~
data/smoke/skip/test.yaml DELETED
@@ -1,16 +0,0 @@
1
- ---
2
- test:
3
- skip.rb:
4
- diagnostics:
5
- - |
6
- skip.rb:8:7: [error] Type `::Object` does not have method `no_such_method`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ self.no_such_method
10
- ~~~~~~~~~~~~~~
11
- - |
12
- skip.rb:12:7: [error] Type `::Object` does not have method `no_such_method`
13
- │ Diagnostic ID: Ruby::NoMethod
14
-
15
- └ self.no_such_method
16
- ~~~~~~~~~~~~~~
@@ -1,4 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics: []
@@ -1,52 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:6:4: [error] Cannot assign a value of type `::Object` to a variable of type `::Integer`
7
- │ ::Object <: ::Integer
8
- │ ::BasicObject <: ::Integer
9
-
10
- │ Diagnostic ID: Ruby::IncompatibleAssignment
11
-
12
- └ a = super(x)
13
- ~~~~~~~~~~~~
14
- - |
15
- a.rb:7:4: [error] Cannot assign a value of type `::Object` to a variable of type `::Integer`
16
- │ ::Object <: ::Integer
17
- │ ::BasicObject <: ::Integer
18
-
19
- │ Diagnostic ID: Ruby::IncompatibleAssignment
20
-
21
- └ a = super
22
- ~~~~~~~~~
23
- - |
24
- a.rb:19:4: [error] Cannot detect the type of the expression
25
- │ Diagnostic ID: Ruby::FallbackAny
26
-
27
- └ super()
28
- ~~~~~~~
29
- - |
30
- a.rb:20:4: [error] Cannot detect the type of the expression
31
- │ Diagnostic ID: Ruby::FallbackAny
32
-
33
- └ super
34
- ~~~~~
35
- - |
36
- a.rb:26:4: [error] UnexpectedSuper
37
- │ Diagnostic ID: Ruby::UnexpectedSuper
38
-
39
- └ super()
40
- ~~~~~~~
41
- - |
42
- a.rb:28:4: [error] UnexpectedSuper
43
- │ Diagnostic ID: Ruby::UnexpectedSuper
44
-
45
- └ super
46
- ~~~~~
47
- - |
48
- a.rb:28:4: [error] Cannot detect the type of the expression
49
- │ Diagnostic ID: Ruby::FallbackAny
50
-
51
- └ super
52
- ~~~~~
@@ -1,12 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:1:0: [error] Cannot allow method body have type `nil` because declared as type `::String`
7
- │ nil <: ::String
8
-
9
- │ Diagnostic ID: Ruby::MethodBodyTypeMismatch
10
-
11
- └ def fizz_buzz(n)
12
- ~~~~~~~~~~~~~~~~
@@ -1,32 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:7:0: [error] Cannot assign a value of type `^() -> ::Hash[::Integer, ::Array[::Integer]]` to a variable of type `^() { (::Integer) -> void } -> void`
7
- │ ^() -> ::Hash[::Integer, ::Array[::Integer]] <: ^() { (::Integer) -> void } -> void
8
-
9
- │ Diagnostic ID: Ruby::IncompatibleAssignment
10
-
11
- └ each_node = -> (&b) { g.each_key(&b) }
12
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13
- - |
14
- a.rb:9:0: [error] Cannot assign a value of type `^(::Integer) -> ::Array[::Integer]` to a variable of type `^(::Integer) { (::Integer) -> void } -> void`
15
- │ ^(::Integer) -> ::Array[::Integer] <: ^(::Integer) { (::Integer) -> void } -> void
16
-
17
- │ Diagnostic ID: Ruby::IncompatibleAssignment
18
-
19
- └ each_child = -> (n, &b) { g[n].each(&b) }
20
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
- - |
22
- a.rb:12:0: [error] Cannot assign a value of type `::Array[::Integer]` to a variable of type `::Array[::String]`
23
- │ ::Array[::Integer] <: ::Array[::String]
24
- │ ::Integer <: ::String
25
- │ ::Numeric <: ::String
26
- │ ::Object <: ::String
27
- │ ::BasicObject <: ::String
28
-
29
- │ Diagnostic ID: Ruby::IncompatibleAssignment
30
-
31
- └ xs = TSort.tsort(each_node, each_child)
32
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1,33 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:7:4: [error] Type `(::Integer | ::String)` does not have method `foobar`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ x.foobar()
10
- ~~~~~~
11
- - |
12
- a.rb:12:4: [error] Type `(::Integer | ::String | ::Symbol)` does not have method `foobar`
13
- │ Diagnostic ID: Ruby::NoMethod
14
-
15
- └ x.foobar
16
- ~~~~~~
17
- - |
18
- a.rb:17:4: [error] Type `1` does not have method `foobar`
19
- │ Diagnostic ID: Ruby::NoMethod
20
-
21
- └ x.foobar
22
- ~~~~~~
23
- - |
24
- a.rb:23:2: [error] Type annotation about `x` is incompatible since ::Integer <: ::String doesn't hold
25
- │ ::Integer <: ::String
26
- │ ::Numeric <: ::String
27
- │ ::Object <: ::String
28
- │ ::BasicObject <: ::String
29
-
30
- │ Diagnostic ID: Ruby::IncompatibleAnnotation
31
-
32
- └ x + 1
33
- ~~~~~
@@ -1,49 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:6:4: [error] Cannot assign a value of type `::Integer` to a variable of type `::String`
7
- │ ::Integer <: ::String
8
- │ ::Numeric <: ::String
9
- │ ::Object <: ::String
10
- │ ::BasicObject <: ::String
11
-
12
- │ Diagnostic ID: Ruby::IncompatibleAssignment
13
-
14
- └ x = yield(3)
15
- ~~~~~~~~~~~~
16
- - |
17
- a.rb:8:10: [error] Cannot assign a value of type `::String` to an expression of type `::Integer`
18
- │ ::String <: ::Integer
19
- │ ::Object <: ::Integer
20
- │ ::BasicObject <: ::Integer
21
-
22
- │ Diagnostic ID: Ruby::IncompatibleAssignment
23
-
24
- └ yield(x)
25
- ~
26
- - |
27
- a.rb:13:4: [error] No block given for `yield`
28
- │ Diagnostic ID: Ruby::UnexpectedYield
29
-
30
- └ yield 4
31
- ~~~~~~~
32
- - |
33
- a.rb:13:4: [error] Cannot detect the type of the expression
34
- │ Diagnostic ID: Ruby::FallbackAny
35
-
36
- └ yield 4
37
- ~~~~~~~
38
- b.rb:
39
- diagnostics:
40
- - |
41
- b.rb:4:10: [error] Cannot assign a value of type `::String` to an expression of type `::Integer`
42
- │ ::String <: ::Integer
43
- │ ::Object <: ::Integer
44
- │ ::BasicObject <: ::Integer
45
-
46
- │ Diagnostic ID: Ruby::IncompatibleAssignment
47
-
48
- └ yield ""
49
- ~~