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,13 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 5
7
+ character: 15
8
+ end:
9
+ line: 5
10
+ character: 18
11
+ severity: ERROR
12
+ message: Type `::Integer` does not have method `foo`
13
+ code: Ruby::NoMethod
@@ -0,0 +1,62 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 4
7
+ character: 0
8
+ end:
9
+ line: 9
10
+ character: 7
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::String` to a variable of type `::Integer`
14
+ ::String <: ::Integer
15
+ ::Object <: ::Integer
16
+ ::BasicObject <: ::Integer
17
+ code: Ruby::IncompatibleAssignment
18
+ - range:
19
+ start:
20
+ line: 7
21
+ character: 6
22
+ end:
23
+ line: 7
24
+ character: 14
25
+ severity: ERROR
26
+ message: |-
27
+ Cannot assign a value of type `::Symbol` to a variable of type `::Integer`
28
+ ::Symbol <: ::Integer
29
+ ::Object <: ::Integer
30
+ ::BasicObject <: ::Integer
31
+ code: Ruby::IncompatibleAssignment
32
+ - range:
33
+ start:
34
+ line: 13
35
+ character: 0
36
+ end:
37
+ line: 18
38
+ character: 3
39
+ severity: ERROR
40
+ message: |-
41
+ Cannot allow method body have type `::Integer` because declared as type `::String`
42
+ ::Integer <: ::String
43
+ ::Numeric <: ::String
44
+ ::Object <: ::String
45
+ ::BasicObject <: ::String
46
+ code: Ruby::MethodBodyTypeMismatch
47
+ - range:
48
+ start:
49
+ line: 16
50
+ character: 2
51
+ end:
52
+ line: 16
53
+ character: 9
54
+ severity: ERROR
55
+ message: |-
56
+ Cannot find compatible overloading of method `+` of type `::Integer`
57
+ Method types:
58
+ def +: (::Integer) -> ::Integer
59
+ | (::Float) -> ::Float
60
+ | (::Rational) -> ::Rational
61
+ | (::Complex) -> ::Complex
62
+ code: Ruby::UnresolvedOverloading
@@ -0,0 +1,135 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 5
7
+ character: 0
8
+ end:
9
+ line: 8
10
+ character: 3
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::String` to a variable of type `::Hash[::Symbol, ::String]`
14
+ ::String <: ::Hash[::Symbol, ::String]
15
+ ::Object <: ::Hash[::Symbol, ::String]
16
+ ::BasicObject <: ::Hash[::Symbol, ::String]
17
+ code: Ruby::IncompatibleAssignment
18
+ - range:
19
+ start:
20
+ line: 6
21
+ character: 2
22
+ end:
23
+ line: 6
24
+ character: 10
25
+ severity: ERROR
26
+ message: |-
27
+ Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
28
+ ::Integer <: ::Hash[::Symbol, ::String]
29
+ ::Numeric <: ::Hash[::Symbol, ::String]
30
+ ::Object <: ::Hash[::Symbol, ::String]
31
+ ::BasicObject <: ::Hash[::Symbol, ::String]
32
+ code: Ruby::IncompatibleAssignment
33
+ - range:
34
+ start:
35
+ line: 7
36
+ character: 2
37
+ end:
38
+ line: 7
39
+ character: 10
40
+ severity: ERROR
41
+ message: |-
42
+ Cannot assign a value of type `::String` to a variable of type `::Hash[::Symbol, ::String]`
43
+ ::String <: ::Hash[::Symbol, ::String]
44
+ ::Object <: ::Hash[::Symbol, ::String]
45
+ ::BasicObject <: ::Hash[::Symbol, ::String]
46
+ code: Ruby::IncompatibleAssignment
47
+ - range:
48
+ start:
49
+ line: 10
50
+ character: 0
51
+ end:
52
+ line: 13
53
+ character: 3
54
+ severity: ERROR
55
+ message: |-
56
+ Cannot assign a value of type `::Array[::Integer]` to a variable of type `::Hash[::Symbol, ::String]`
57
+ ::Array[::Integer] <: ::Hash[::Symbol, ::String]
58
+ ::Object <: ::Hash[::Symbol, ::String]
59
+ ::BasicObject <: ::Hash[::Symbol, ::String]
60
+ code: Ruby::IncompatibleAssignment
61
+ - range:
62
+ start:
63
+ line: 11
64
+ character: 2
65
+ end:
66
+ line: 11
67
+ character: 10
68
+ severity: ERROR
69
+ message: |-
70
+ Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
71
+ ::Integer <: ::Hash[::Symbol, ::String]
72
+ ::Numeric <: ::Hash[::Symbol, ::String]
73
+ ::Object <: ::Hash[::Symbol, ::String]
74
+ ::BasicObject <: ::Hash[::Symbol, ::String]
75
+ code: Ruby::IncompatibleAssignment
76
+ - range:
77
+ start:
78
+ line: 12
79
+ character: 2
80
+ end:
81
+ line: 12
82
+ character: 10
83
+ severity: ERROR
84
+ message: |-
85
+ Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
86
+ ::Integer <: ::Hash[::Symbol, ::String]
87
+ ::Numeric <: ::Hash[::Symbol, ::String]
88
+ ::Object <: ::Hash[::Symbol, ::String]
89
+ ::BasicObject <: ::Hash[::Symbol, ::String]
90
+ code: Ruby::IncompatibleAssignment
91
+ - file: b.rb
92
+ diagnostics:
93
+ - range:
94
+ start:
95
+ line: 6
96
+ character: 4
97
+ end:
98
+ line: 9
99
+ character: 3
100
+ severity: ERROR
101
+ message: |-
102
+ Cannot find compatible overloading of method `with_object` of type `::Enumerator[::Integer, ::Array[::Integer]]`
103
+ Method types:
104
+ def with_object: [U] (U) { (::Integer, U) -> untyped } -> U
105
+ | [U] (U) -> ::Enumerator[[::Integer, U], ::Array[::Integer]]
106
+ code: Ruby::UnresolvedOverloading
107
+ - range:
108
+ start:
109
+ line: 11
110
+ character: 0
111
+ end:
112
+ line: 14
113
+ character: 3
114
+ severity: ERROR
115
+ message: |-
116
+ Cannot assign a value of type `::Array[::String]` to a variable of type `::Array[::Integer]`
117
+ ::Array[::String] <: ::Array[::Integer]
118
+ ::String <: ::Integer
119
+ ::Object <: ::Integer
120
+ ::BasicObject <: ::Integer
121
+ code: Ruby::IncompatibleAssignment
122
+ - range:
123
+ start:
124
+ line: 17
125
+ character: 0
126
+ end:
127
+ line: 19
128
+ character: 3
129
+ severity: ERROR
130
+ message: |-
131
+ Cannot assign a value of type `::Array[untyped]` to a variable of type `::String`
132
+ ::Array[untyped] <: ::String
133
+ ::Object <: ::String
134
+ ::BasicObject <: ::String
135
+ code: Ruby::IncompatibleAssignment
@@ -0,0 +1,61 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 8
7
+ character: 2
8
+ end:
9
+ line: 8
10
+ character: 12
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::Foo` to a variable of type `::String`
14
+ ::Foo <: ::String
15
+ ::Object <: ::String
16
+ ::BasicObject <: ::String
17
+ code: Ruby::IncompatibleAssignment
18
+ - file: b.rb
19
+ diagnostics:
20
+ - range:
21
+ start:
22
+ line: 7
23
+ character: 0
24
+ end:
25
+ line: 7
26
+ character: 17
27
+ severity: ERROR
28
+ message: |-
29
+ Cannot assign a value of type `::String` to a variable of type `::Integer`
30
+ ::String <: ::Integer
31
+ ::Object <: ::Integer
32
+ ::BasicObject <: ::Integer
33
+ code: Ruby::IncompatibleAssignment
34
+ - range:
35
+ start:
36
+ line: 10
37
+ character: 0
38
+ end:
39
+ line: 10
40
+ character: 16
41
+ severity: ERROR
42
+ message: |-
43
+ Cannot assign a value of type `::Object` to a variable of type `::Integer`
44
+ ::Object <: ::Integer
45
+ ::BasicObject <: ::Integer
46
+ code: Ruby::IncompatibleAssignment
47
+ - file: c.rb
48
+ diagnostics:
49
+ - range:
50
+ start:
51
+ line: 6
52
+ character: 4
53
+ end:
54
+ line: 6
55
+ character: 20
56
+ severity: ERROR
57
+ message: |-
58
+ Cannot assign a value of type `::Object` to a variable of type `::String`
59
+ ::Object <: ::String
60
+ ::BasicObject <: ::String
61
+ code: Ruby::IncompatibleAssignment
@@ -0,0 +1,81 @@
1
+ ---
2
+ - file: b.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 6
7
+ character: 0
8
+ end:
9
+ line: 6
10
+ character: 14
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::Hash[::Symbol, ::Integer]` to a variable of type `::Hash[::Symbol, (::String | nil)]`
14
+ ::Hash[::Symbol, ::Integer] <: ::Hash[::Symbol, (::String | nil)]
15
+ ::Integer <: (::String | nil)
16
+ ::Integer <: ::String
17
+ ::Numeric <: ::String
18
+ ::Object <: ::String
19
+ ::BasicObject <: ::String
20
+ code: Ruby::IncompatibleAssignment
21
+ - file: c.rb
22
+ diagnostics:
23
+ - range:
24
+ start:
25
+ line: 5
26
+ character: 3
27
+ end:
28
+ line: 5
29
+ character: 10
30
+ severity: ERROR
31
+ message: Type `::Integer` does not have method `abcdefg`
32
+ code: Ruby::NoMethod
33
+ - range:
34
+ start:
35
+ line: 8
36
+ character: 5
37
+ end:
38
+ line: 8
39
+ character: 12
40
+ severity: ERROR
41
+ message: Type `::String` does not have method `abcdefg`
42
+ code: Ruby::NoMethod
43
+ - range:
44
+ start:
45
+ line: 10
46
+ character: 30
47
+ end:
48
+ line: 10
49
+ character: 37
50
+ severity: ERROR
51
+ message: Type `(::Integer | ::String)` does not have method `abcdefg`
52
+ code: Ruby::NoMethod
53
+ - file: d.rb
54
+ diagnostics:
55
+ - range:
56
+ start:
57
+ line: 5
58
+ character: 0
59
+ end:
60
+ line: 5
61
+ character: 66
62
+ severity: ERROR
63
+ message: |-
64
+ Cannot assign a value of type `{ :email => ::String, :id => ::String, :name => ::String }` to a variable of type `{ :id => ::Integer, :name => ::String }`
65
+ { :email => ::String, :id => ::String, :name => ::String } <: { :id => ::Integer, :name => ::String }
66
+ ::String <: ::Integer
67
+ ::Object <: ::Integer
68
+ ::BasicObject <: ::Integer
69
+ code: Ruby::IncompatibleAssignment
70
+ - file: e.rb
71
+ diagnostics:
72
+ - range:
73
+ start:
74
+ line: 1
75
+ character: 24
76
+ end:
77
+ line: 1
78
+ character: 37
79
+ severity: ERROR
80
+ message: Type `::Integer` does not have method `fffffffffffff`
81
+ code: Ruby::NoMethod
@@ -0,0 +1,25 @@
1
+ ---
2
+ - file: hello.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 9
7
+ character: 6
8
+ end:
9
+ line: 9
10
+ character: 9
11
+ severity: ERROR
12
+ message: Type `::_Bar` does not have method `foo`
13
+ code: Ruby::NoMethod
14
+ - range:
15
+ start:
16
+ line: 11
17
+ character: 0
18
+ end:
19
+ line: 11
20
+ character: 5
21
+ severity: ERROR
22
+ message: |-
23
+ Cannot assign a value of type `::_Bar` to a variable of type `::_Foo`
24
+ ::_Bar <: ::_Foo
25
+ code: Ruby::IncompatibleAssignment
@@ -0,0 +1,34 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 5
7
+ character: 0
8
+ end:
9
+ line: 7
10
+ character: 7
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `(::Symbol | nil)` to a variable of type `::String`
14
+ (::Symbol | nil) <: ::String
15
+ ::Symbol <: ::String
16
+ ::Object <: ::String
17
+ ::BasicObject <: ::String
18
+ code: Ruby::IncompatibleAssignment
19
+ - range:
20
+ start:
21
+ line: 15
22
+ character: 0
23
+ end:
24
+ line: 19
25
+ character: 7
26
+ severity: ERROR
27
+ message: |-
28
+ Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::String`
29
+ (::String | ::Integer) <: ::String
30
+ ::Integer <: ::String
31
+ ::Numeric <: ::String
32
+ ::Object <: ::String
33
+ ::BasicObject <: ::String
34
+ code: Ruby::IncompatibleAssignment
@@ -0,0 +1,23 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 1
7
+ character: 6
8
+ end:
9
+ line: 1
10
+ character: 7
11
+ severity: ERROR
12
+ message: Cannot find implementation of method `::A#baz`
13
+ code: Ruby::MethodDefinitionMissing
14
+ - range:
15
+ start:
16
+ line: 1
17
+ character: 6
18
+ end:
19
+ line: 1
20
+ character: 7
21
+ severity: ERROR
22
+ message: Cannot find implementation of method `::A.bar`
23
+ code: Ruby::MethodDefinitionMissing
@@ -0,0 +1 @@
1
+ --- []