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,101 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 4
7
+ character: 10
8
+ end:
9
+ line: 4
10
+ character: 13
11
+ severity: ERROR
12
+ message: Type `::Integer` does not have method `foo`
13
+ code: Ruby::NoMethod
14
+ - range:
15
+ start:
16
+ line: 7
17
+ character: 10
18
+ end:
19
+ line: 7
20
+ character: 13
21
+ severity: ERROR
22
+ message: Type `::Integer` does not have method `foo`
23
+ code: Ruby::NoMethod
24
+ - range:
25
+ start:
26
+ line: 12
27
+ character: 20
28
+ end:
29
+ line: 12
30
+ character: 29
31
+ severity: ERROR
32
+ message: Cannot detect the type of the expression
33
+ code: Ruby::FallbackAny
34
+ - range:
35
+ start:
36
+ line: 13
37
+ character: 10
38
+ end:
39
+ line: 13
40
+ character: 13
41
+ severity: ERROR
42
+ message: Type `::Integer` does not have method `foo`
43
+ code: Ruby::NoMethod
44
+ - range:
45
+ start:
46
+ line: 18
47
+ character: 20
48
+ end:
49
+ line: 18
50
+ character: 27
51
+ severity: ERROR
52
+ message: Cannot detect the type of the expression
53
+ code: Ruby::FallbackAny
54
+ - range:
55
+ start:
56
+ line: 19
57
+ character: 10
58
+ end:
59
+ line: 19
60
+ character: 13
61
+ severity: ERROR
62
+ message: Type `::Integer` does not have method `foo`
63
+ code: Ruby::NoMethod
64
+ - range:
65
+ start:
66
+ line: 22
67
+ character: 10
68
+ end:
69
+ line: 22
70
+ character: 13
71
+ severity: ERROR
72
+ message: Type `::Integer` does not have method `foo`
73
+ code: Ruby::NoMethod
74
+ - range:
75
+ start:
76
+ line: 24
77
+ character: 0
78
+ end:
79
+ line: 24
80
+ character: 19
81
+ severity: ERROR
82
+ message: |-
83
+ Cannot find compatible overloading of method `Integer` of type `::Object`
84
+ Method types:
85
+ def Integer: ((::Numeric | ::String), ?exception: bool) -> ::Integer
86
+ | (::String, ?::Integer, ?exception: bool) -> ::Integer
87
+ code: Ruby::UnresolvedOverloading
88
+ - range:
89
+ start:
90
+ line: 26
91
+ character: 0
92
+ end:
93
+ line: 26
94
+ character: 12
95
+ severity: ERROR
96
+ message: |-
97
+ Cannot find compatible overloading of method `Integer` of type `::Object`
98
+ Method types:
99
+ def Integer: ((::Numeric | ::String), ?exception: bool) -> ::Integer
100
+ | (::String, ?::Integer, ?exception: bool) -> ::Integer
101
+ code: Ruby::UnresolvedOverloading
@@ -0,0 +1,23 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 5
7
+ character: 12
8
+ end:
9
+ line: 5
10
+ character: 15
11
+ severity: ERROR
12
+ message: Type `::A::Object` does not have method `bar`
13
+ code: Ruby::NoMethod
14
+ - range:
15
+ start:
16
+ line: 10
17
+ character: 11
18
+ end:
19
+ line: 10
20
+ character: 18
21
+ severity: ERROR
22
+ message: Type `::Object` does not have method `object?`
23
+ code: Ruby::NoMethod
@@ -0,0 +1,17 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 3
7
+ character: 0
8
+ end:
9
+ line: 7
10
+ character: 3
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
@@ -0,0 +1,39 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 3
7
+ character: 0
8
+ end:
9
+ line: 7
10
+ character: 17
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: 10
21
+ character: 0
22
+ end:
23
+ line: 12
24
+ character: 3
25
+ severity: ERROR
26
+ message: |-
27
+ Cannot assign a value of type `::Proc` to a variable of type `^(::Integer) -> ::Integer`
28
+ ::Proc <: ^(::Integer) -> ::Integer
29
+ code: Ruby::IncompatibleAssignment
30
+ - range:
31
+ start:
32
+ line: 11
33
+ character: 4
34
+ end:
35
+ line: 11
36
+ character: 5
37
+ severity: ERROR
38
+ message: Type `nil` does not have method `+`
39
+ code: Ruby::NoMethod
@@ -0,0 +1,106 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 4
7
+ character: 0
8
+ end:
9
+ line: 4
10
+ character: 5
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
14
+ ::Integer <: ::String
15
+ ::Numeric <: ::String
16
+ ::Object <: ::String
17
+ ::BasicObject <: ::String
18
+ code: Ruby::IncompatibleAssignment
19
+ - range:
20
+ start:
21
+ line: 6
22
+ character: 0
23
+ end:
24
+ line: 6
25
+ character: 8
26
+ severity: ERROR
27
+ message: |-
28
+ Cannot assign a value of type `::Symbol` to a variable of type `::String`
29
+ ::Symbol <: ::String
30
+ ::Object <: ::String
31
+ ::BasicObject <: ::String
32
+ code: Ruby::IncompatibleAssignment
33
+ - range:
34
+ start:
35
+ line: 8
36
+ character: 0
37
+ end:
38
+ line: 8
39
+ character: 9
40
+ severity: ERROR
41
+ message: |-
42
+ Cannot assign a value of type `::String` to a variable of type `::Integer`
43
+ ::String <: ::Integer
44
+ ::Object <: ::Integer
45
+ ::BasicObject <: ::Integer
46
+ code: Ruby::IncompatibleAssignment
47
+ - range:
48
+ start:
49
+ line: 10
50
+ character: 0
51
+ end:
52
+ line: 10
53
+ character: 8
54
+ severity: ERROR
55
+ message: |-
56
+ Cannot assign a value of type `bool` to a variable of type `::String`
57
+ bool <: ::String
58
+ (true | false) <: ::String
59
+ true <: ::String
60
+ ::TrueClass <: ::String
61
+ ::Object <: ::String
62
+ ::BasicObject <: ::String
63
+ code: Ruby::IncompatibleAssignment
64
+ - range:
65
+ start:
66
+ line: 11
67
+ character: 0
68
+ end:
69
+ line: 11
70
+ character: 9
71
+ severity: ERROR
72
+ message: |-
73
+ Cannot assign a value of type `bool` to a variable of type `::Integer`
74
+ bool <: ::Integer
75
+ (true | false) <: ::Integer
76
+ true <: ::Integer
77
+ ::TrueClass <: ::Integer
78
+ ::Object <: ::Integer
79
+ ::BasicObject <: ::Integer
80
+ code: Ruby::IncompatibleAssignment
81
+ - file: b.rb
82
+ diagnostics:
83
+ - range:
84
+ start:
85
+ line: 4
86
+ character: 6
87
+ end:
88
+ line: 4
89
+ character: 7
90
+ severity: ERROR
91
+ message: |-
92
+ Cannot pass a value of type `::Integer` as an argument of type `3`
93
+ ::Integer <: 3
94
+ code: Ruby::ArgumentTypeMismatch
95
+ - range:
96
+ start:
97
+ line: 7
98
+ character: 11
99
+ end:
100
+ line: 7
101
+ character: 15
102
+ severity: ERROR
103
+ message: |-
104
+ Cannot assign a value of type `::Symbol` to an expression of type `:foo`
105
+ ::Symbol <: :foo
106
+ code: Ruby::IncompatibleAssignment
@@ -0,0 +1 @@
1
+ --- []
@@ -0,0 +1,90 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 3
7
+ character: 0
8
+ end:
9
+ line: 11
10
+ character: 3
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot allow method body have type `::Integer` because declared as type `::String`
14
+ ::Integer <: ::String
15
+ ::Numeric <: ::String
16
+ ::Object <: ::String
17
+ ::BasicObject <: ::String
18
+ code: Ruby::MethodBodyTypeMismatch
19
+ - range:
20
+ start:
21
+ line: 6
22
+ character: 2
23
+ end:
24
+ line: 6
25
+ character: 7
26
+ severity: ERROR
27
+ message: |-
28
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
29
+ ::Integer <: ::String
30
+ ::Numeric <: ::String
31
+ ::Object <: ::String
32
+ ::BasicObject <: ::String
33
+ code: Ruby::IncompatibleAssignment
34
+ - range:
35
+ start:
36
+ line: 8
37
+ character: 2
38
+ end:
39
+ line: 8
40
+ character: 7
41
+ severity: ERROR
42
+ message: |-
43
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
44
+ ::Integer <: ::String
45
+ ::Numeric <: ::String
46
+ ::Object <: ::String
47
+ ::BasicObject <: ::String
48
+ code: Ruby::IncompatibleAssignment
49
+ - range:
50
+ start:
51
+ line: 15
52
+ character: 7
53
+ end:
54
+ line: 15
55
+ character: 13
56
+ severity: ERROR
57
+ message: Method parameters are incompatible with declaration `(::Integer) -> ::String`
58
+ code: Ruby::MethodArityMismatch
59
+ - range:
60
+ start:
61
+ line: 18
62
+ character: 2
63
+ end:
64
+ line: 18
65
+ character: 7
66
+ severity: ERROR
67
+ message: |-
68
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
69
+ ::Integer <: ::String
70
+ ::Numeric <: ::String
71
+ ::Object <: ::String
72
+ ::BasicObject <: ::String
73
+ code: Ruby::IncompatibleAssignment
74
+ - file: b.rb
75
+ diagnostics:
76
+ - range:
77
+ start:
78
+ line: 4
79
+ character: 2
80
+ end:
81
+ line: 6
82
+ character: 5
83
+ severity: ERROR
84
+ message: |-
85
+ Cannot allow method body have type `::Symbol` because declared as type `(::Integer | ::String)`
86
+ ::Symbol <: (::Integer | ::String)
87
+ ::Symbol <: ::Integer
88
+ ::Object <: ::Integer
89
+ ::BasicObject <: ::Integer
90
+ code: Ruby::MethodBodyTypeMismatch
@@ -0,0 +1,75 @@
1
+ ---
2
+ - file: a.rb
3
+ diagnostics:
4
+ - range:
5
+ start:
6
+ line: 13
7
+ character: 4
8
+ end:
9
+ line: 13
10
+ character: 9
11
+ severity: ERROR
12
+ message: |-
13
+ Cannot assign a value of type `::Integer` to a variable of type `::String`
14
+ ::Integer <: ::String
15
+ ::Numeric <: ::String
16
+ ::Object <: ::String
17
+ ::BasicObject <: ::String
18
+ code: Ruby::IncompatibleAssignment
19
+ - range:
20
+ start:
21
+ line: 15
22
+ character: 4
23
+ end:
24
+ line: 15
25
+ character: 7
26
+ severity: ERROR
27
+ message: Type `(::Object & ::_Each2[::Integer, ::A] & ::A)` does not have method
28
+ `foo`
29
+ code: Ruby::NoMethod
30
+ - file: c.rb
31
+ diagnostics:
32
+ - range:
33
+ start:
34
+ line: 21
35
+ character: 2
36
+ end:
37
+ line: 21
38
+ character: 26
39
+ severity: ERROR
40
+ message: Type `singleton(::A)` does not have method `no_such_method_in_module`
41
+ code: Ruby::NoMethod
42
+ - file: d.rb
43
+ diagnostics:
44
+ - range:
45
+ start:
46
+ line: 3
47
+ character: 7
48
+ end:
49
+ line: 3
50
+ character: 8
51
+ severity: ERROR
52
+ message: Cannot find implementation of method `::X#foo`
53
+ code: Ruby::MethodDefinitionMissing
54
+ - file: f.rb
55
+ diagnostics:
56
+ - range:
57
+ start:
58
+ line: 1
59
+ character: 7
60
+ end:
61
+ line: 1
62
+ character: 14
63
+ severity: ERROR
64
+ message: Cannot find implementation of method `::Palette.nestopia_palette`
65
+ code: Ruby::MethodDefinitionMissing
66
+ - range:
67
+ start:
68
+ line: 1
69
+ character: 7
70
+ end:
71
+ line: 1
72
+ character: 14
73
+ severity: ERROR
74
+ message: "@dynamic annotation contains unknown method name `nestopia_palette`"
75
+ code: Ruby::UnexpectedDynamicMethod