rbs 2.4.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +3 -3
  4. data/CHANGELOG.md +83 -0
  5. data/Gemfile.lock +12 -12
  6. data/Rakefile +6 -38
  7. data/Steepfile +6 -2
  8. data/core/constants.rbs +1 -1
  9. data/core/env.rbs +1 -1323
  10. data/core/global_variables.rbs +1 -1
  11. data/core/hash.rbs +3 -3
  12. data/core/kernel.rbs +2 -2
  13. data/core/random.rbs +5 -220
  14. data/core/rational.rbs +3 -3
  15. data/core/rbs/unnamed/argf.rbs +965 -0
  16. data/core/rbs/unnamed/env_class.rbs +1325 -0
  17. data/core/rbs/unnamed/random.rbs +270 -0
  18. data/core/regexp.rbs +2 -3
  19. data/core/time.rbs +5 -5
  20. data/docs/CONTRIBUTING.md +2 -2
  21. data/ext/rbs_extension/lexer.c +1406 -1409
  22. data/ext/rbs_extension/lexer.h +2 -1
  23. data/ext/rbs_extension/lexer.re +4 -3
  24. data/ext/rbs_extension/lexstate.c +1 -0
  25. data/ext/rbs_extension/parser.c +8 -0
  26. data/ext/rbs_extension/rbs_extension.h +1 -1
  27. data/ext/rbs_extension/unescape.c +17 -10
  28. data/lib/rbs/ast/members.rb +7 -3
  29. data/lib/rbs/cli.rb +97 -18
  30. data/lib/rbs/factory.rb +2 -0
  31. data/lib/rbs/prototype/helpers.rb +1 -5
  32. data/lib/rbs/prototype/rb.rb +111 -57
  33. data/lib/rbs/prototype/rbi.rb +65 -30
  34. data/lib/rbs/prototype/runtime.rb +4 -3
  35. data/lib/rbs/test/setup_helper.rb +6 -1
  36. data/lib/rbs/version.rb +1 -1
  37. data/schema/members.json +8 -2
  38. data/sig/collection/config.rbs +3 -0
  39. data/sig/factory.rbs +5 -0
  40. data/sig/prototype/helpers.rbs +23 -0
  41. data/sig/prototype/rb.rbs +84 -0
  42. data/sig/prototype/rbi.rbs +73 -0
  43. data/sig/shims/abstract_syntax_tree.rbs +25 -0
  44. data/sig/shims/enumerable.rbs +5 -0
  45. data/sig/shims/pp.rbs +3 -0
  46. data/sig/shims/ripper.rbs +8 -0
  47. data/stdlib/cgi/0/manifest.yaml +2 -0
  48. data/stdlib/date/0/time.rbs +26 -0
  49. data/stdlib/etc/0/etc.rbs +745 -0
  50. data/stdlib/minitest/0/kernel.rbs +42 -0
  51. data/stdlib/minitest/0/manifest.yaml +2 -0
  52. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +49 -0
  53. data/stdlib/minitest/0/minitest/assertion.rbs +16 -0
  54. data/stdlib/minitest/0/minitest/assertions.rbs +545 -0
  55. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +16 -0
  56. data/stdlib/minitest/0/minitest/bench_spec.rbs +102 -0
  57. data/stdlib/minitest/0/minitest/benchmark.rbs +258 -0
  58. data/stdlib/minitest/0/minitest/composite_reporter.rbs +25 -0
  59. data/stdlib/minitest/0/minitest/expectation.rbs +2 -0
  60. data/stdlib/minitest/0/minitest/expectations.rbs +21 -0
  61. data/stdlib/minitest/0/minitest/guard.rbs +64 -0
  62. data/stdlib/minitest/0/minitest/mock.rbs +60 -0
  63. data/stdlib/minitest/0/minitest/parallel/executor.rbs +42 -0
  64. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +6 -0
  65. data/stdlib/minitest/0/minitest/parallel/test.rbs +3 -0
  66. data/stdlib/minitest/0/minitest/parallel.rbs +2 -0
  67. data/stdlib/minitest/0/minitest/pride_io.rbs +54 -0
  68. data/stdlib/minitest/0/minitest/pride_lol.rbs +17 -0
  69. data/stdlib/minitest/0/minitest/progress_reporter.rbs +11 -0
  70. data/stdlib/minitest/0/minitest/reportable.rbs +51 -0
  71. data/stdlib/minitest/0/minitest/reporter.rbs +5 -0
  72. data/stdlib/minitest/0/minitest/result.rbs +28 -0
  73. data/stdlib/minitest/0/minitest/runnable.rbs +131 -0
  74. data/stdlib/minitest/0/minitest/skip.rbs +6 -0
  75. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +48 -0
  76. data/stdlib/minitest/0/minitest/spec/dsl.rbs +125 -0
  77. data/stdlib/minitest/0/minitest/spec.rbs +11 -0
  78. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +76 -0
  79. data/stdlib/minitest/0/minitest/summary_reporter.rbs +25 -0
  80. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +92 -0
  81. data/stdlib/minitest/0/minitest/test.rbs +76 -0
  82. data/stdlib/minitest/0/minitest/unexpected_error.rbs +10 -0
  83. data/stdlib/minitest/0/minitest/unit/test_case.rbs +3 -0
  84. data/stdlib/minitest/0/minitest/unit.rbs +5 -0
  85. data/stdlib/minitest/0/minitest.rbs +966 -0
  86. data/stdlib/rubygems/0/errors.rbs +113 -0
  87. data/steep/Gemfile.lock +4 -4
  88. metadata +53 -3
  89. data/lib/rbs/char_scanner.rb +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7f806cf8264c7ba086b2462e42604febb347b00cc657e642e39070e30825378
4
- data.tar.gz: d3bcc382fb797715e27f811c0cd8b1876ef0d37a85599e169d9ce6f2a7bbbed3
3
+ metadata.gz: b7c0492a40dd2d8ce395ddb823807f2a33d76646a5a63edbbed4fbae0c924e28
4
+ data.tar.gz: 66f2ea0d8fa7982274b687d3d27146db1cded7f45ecce88ed5a320cdbd1b125a
5
5
  SHA512:
6
- metadata.gz: b84abd96145c319fde7b7f4a0a571d7c2c5ec0f959afd1bb3bdaaecb378b74153c235b45ab446e357812e0e29c14d2c4a993af0682c3c9799881720579b03d42
7
- data.tar.gz: e2b41d9c74ccb0f19e553c955959cf0922bb72889e7f75dd7a40abe80f9d4773610c97a585969158d3130a289100d04b1cd533921165f3e84f67c6a84b89aa76
6
+ metadata.gz: 49dc3f14f20efc27a4eb590d36af44e2565dfdc20061260336b6ed2ae88784d5f759759ff602b3ba88c402df110ee13c9d198caa75b7153dafc3938c6df776ea
7
+ data.tar.gz: d4659a14549a0fd7686b8a9e0c8bd7433d688e9470e26780785bb9c627625fc2ac32332298f6d7dc1442316dd6eb439a7c4c0bd99f28c6fbd2cab50698b3d9d3
@@ -29,6 +29,6 @@ jobs:
29
29
  - name: bin/setup
30
30
  run: |
31
31
  bin/setup
32
- - name: Run test
32
+ - name: Check if `rake annotate` has been executed
33
33
  run: |
34
34
  bundle exec rake annotate confirm_annotation
@@ -46,9 +46,9 @@ jobs:
46
46
  if: contains(matrix.job, 'lexer')
47
47
  run: |
48
48
  cd /tmp
49
- curl -L https://github.com/skvadrik/re2c/archive/refs/tags/2.2.tar.gz > re2c-2.2.tar.gz
50
- tar xf re2c-2.2.tar.gz
51
- cd re2c-2.2
49
+ curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.0.tar.gz > re2c-3.0.tar.gz
50
+ tar xf re2c-3.0.tar.gz
51
+ cd re2c-3.0
52
52
  autoreconf -i -W all
53
53
  ./configure
54
54
  make
data/CHANGELOG.md CHANGED
@@ -2,6 +2,89 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.6.0 (2022-06-22)
6
+
7
+ RBS 2.6 ships with `rbs prototype` commands improvements and signature updates.
8
+ New minitest RBS definitions will help you to type check your tests.
9
+
10
+ ### Signature updates
11
+
12
+ * etc ([\#1006](https://github.com/ruby/rbs/pull/1006))
13
+ * minitest ([\#1009](https://github.com/ruby/rbs/pull/1009))
14
+ * date ([\#1033](https://github.com/ruby/rbs/pull/1033))
15
+ * `ENV`. `ARGF`, `Random::Base` ([\#1041](https://github.com/ruby/rbs/pull/1041))
16
+ * `Hash#dig` ([\#1011](https://github.com/ruby/rbs/pull/1011))
17
+ * `Hash#reject` ([\#1016](https://github.com/ruby/rbs/pull/1016))
18
+ * `Kernel?.fail` ([\#1026](https://github.com/ruby/rbs/pull/1026), [\#1028](https://github.com/ruby/rbs/pull/1028))
19
+ * `Rational#*` ([\#1012](https://github.com/ruby/rbs/pull/1012))
20
+ * `Regexp.new` ([\#1040](https://github.com/ruby/rbs/pull/1040))
21
+
22
+ ### Library changes
23
+
24
+ * Add `visibility` columns in {AttrReader,AttrAccessor,AttrWriter}#to_json ([\#1014](https://github.com/ruby/rbs/pull/1014))
25
+ * Add support for RSpec's verifying doubles in test setup helper ([\#1015](https://github.com/ruby/rbs/pull/1015))
26
+ * Fix lexer to analyze escape characters ([\#1043](https://github.com/ruby/rbs/pull/1043))
27
+
28
+ #### rbs prototype
29
+
30
+ * [rb] Support the case where the return value is `self` ([\#1003](https://github.com/ruby/rbs/pull/1003))
31
+ * [rb] Lean to the optional side ([\#1021](https://github.com/ruby/rbs/pull/1021))
32
+ * [rb] Fix method commenting ([\#1027](https://github.com/ruby/rbs/pull/1027))
33
+ * [runtime] Fix decls of output from `Prototype::Runtime` ([\#1030](https://github.com/ruby/rbs/pull/1030))
34
+ * [runtime] Fix class name resolution of prototype runtime ([\#1032](https://github.com/ruby/rbs/pull/1032))
35
+ * [rbi] Improve `Prototype::RBI` ([\#1018](https://github.com/ruby/rbs/pull/1018))
36
+
37
+ ### Miscellaneous
38
+
39
+ * Fix typo in `CONTRIBUTING.md` ([\#1004](https://github.com/ruby/rbs/pull/1004))
40
+ * Use manifest.yaml instead of manually for validate task ([\#1010](https://github.com/ruby/rbs/pull/1010))
41
+ * Update re2c ([\#1017](https://github.com/ruby/rbs/pull/1017))
42
+ * Type check `Prototype::RB` ([\#1019](https://github.com/ruby/rbs/pull/1019))
43
+ * Minor cleanup & fix ([\#1020](https://github.com/ruby/rbs/pull/1020))
44
+ * Fix type errors ([\#1023](https://github.com/ruby/rbs/pull/1023))
45
+ * Clarify GHA step name for rake annotate ([\#1024](https://github.com/ruby/rbs/pull/1024))
46
+ * Silence parser warning ([\#1039](https://github.com/ruby/rbs/pull/1039))
47
+ * Fix warnings ([\#1035](https://github.com/ruby/rbs/pull/1035)
48
+
49
+ ## 2.5.1 (2022-06-19)
50
+
51
+ This is a maintenance release mainly to fix errors detected in CI of `ruby/ruby`.
52
+ Nothing changed related to the users of RBS gem.
53
+
54
+ ### Miscellaneous
55
+
56
+ * Skip failing tests on ruby/ruby CI ([\#1036](https://github.com/ruby/rbs/pull/1036))
57
+ * Fix warnings ([\#1035](https://github.com/ruby/rbs/pull/1035) except changes on `test/tools/sort_test.rb` that is not included in this release)
58
+ * Fix `Regexp.new` argument ([\#1034](https://github.com/ruby/rbs/pull/1034))
59
+ * Fix errors with OpenSSL 3 ([\#1029](https://github.com/ruby/rbs/pull/1029))
60
+ * Fix `OpenSSL::PKey::PKeyError: EVP_PKEY_keygen: bad ffc parameters` with OpenSSL 3 ([\#1005](https://github.com/ruby/rbs/pull/1005))
61
+
62
+ ## 2.5.0 (2022-05-20)
63
+
64
+ This is a minor release with tuple type/record type syntax updates and `rbs prototype` improvements.
65
+
66
+ * You can write empty tuple type as `[]`, instead of `[ ]`
67
+ * You can write empty record type as `{}`
68
+ * `prototype-rb` command with `--out-dir` option generates multiple RBS files in the directory
69
+
70
+ ### Signature updates
71
+
72
+ * `Time` ([\#994](https://github.com/ruby/rbs/pull/994))
73
+
74
+ ### Language updates
75
+
76
+ * Fix empty tuple type syntax and allow empty record type ([\#1001](https://github.com/ruby/rbs/pull/1001))
77
+
78
+ ### Library changes
79
+
80
+ * Add `name` attribute in `MethodDefinition#to_json` ([\#997](https://github.com/ruby/rbs/pull/997))
81
+
82
+ #### rbs prototype
83
+
84
+ * Fix (`ArgumentError`) invalid byte sequence in UTF-8 ([\#995](https://github.com/ruby/rbs/pull/995))
85
+ * Fix broken args after parsed `decls` from `RBS::Prototype::RB` ([\#998](https://github.com/ruby/rbs/pull/998))
86
+ * Add *batch* mode to `rbs prototype` ([\#1000](https://github.com/ruby/rbs/pull/1000))
87
+
5
88
  ## 2.4.0 (2022-05-08)
6
89
 
7
90
  This is a minor release with some signature updates, `prototype rb` improvement, and test fixes.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (2.4.0)
4
+ rbs (2.6.0)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
@@ -17,7 +17,7 @@ GEM
17
17
  dbm (1.1.0)
18
18
  debase (0.2.5.beta2)
19
19
  debase-ruby_core_source (>= 0.10.12)
20
- debase-ruby_core_source (0.10.14)
20
+ debase-ruby_core_source (0.10.16)
21
21
  diff-lcs (1.5.0)
22
22
  digest (3.1.0)
23
23
  forwardable (1.3.2)
@@ -26,11 +26,11 @@ GEM
26
26
  psych (>= 3.1, < 5.0)
27
27
  rainbow (>= 3.0, < 4.0)
28
28
  strong_json (>= 1.1, < 2.2)
29
- json (2.6.1)
29
+ json (2.6.2)
30
30
  json-schema (3.0.0)
31
31
  addressable (>= 2.8)
32
32
  marcel (1.0.2)
33
- minitest (5.15.0)
33
+ minitest (5.16.1)
34
34
  parallel (1.22.1)
35
35
  parser (3.1.2.0)
36
36
  ast (~> 2.4.1)
@@ -38,7 +38,7 @@ GEM
38
38
  prime (0.1.2)
39
39
  forwardable
40
40
  singleton
41
- psych (4.0.3)
41
+ psych (4.0.4)
42
42
  stringio
43
43
  public_suffix (4.0.7)
44
44
  rainbow (3.1.1)
@@ -47,7 +47,7 @@ GEM
47
47
  rake
48
48
  rdoc (6.4.0)
49
49
  psych (>= 4.0.0)
50
- regexp_parser (2.3.1)
50
+ regexp_parser (2.5.0)
51
51
  rexml (3.2.5)
52
52
  rspec (3.11.0)
53
53
  rspec-core (~> 3.11.0)
@@ -62,16 +62,16 @@ GEM
62
62
  diff-lcs (>= 1.2.0, < 2.0)
63
63
  rspec-support (~> 3.11.0)
64
64
  rspec-support (3.11.0)
65
- rubocop (1.28.2)
65
+ rubocop (1.30.1)
66
66
  parallel (~> 1.10)
67
67
  parser (>= 3.1.0.0)
68
68
  rainbow (>= 2.2.2, < 4.0)
69
69
  regexp_parser (>= 1.8, < 3.0)
70
- rexml
71
- rubocop-ast (>= 1.17.0, < 2.0)
70
+ rexml (>= 3.2.5, < 4.0)
71
+ rubocop-ast (>= 1.18.0, < 2.0)
72
72
  ruby-progressbar (~> 1.7)
73
73
  unicode-display_width (>= 1.4.0, < 3.0)
74
- rubocop-ast (1.17.0)
74
+ rubocop-ast (1.18.0)
75
75
  parser (>= 3.1.1.0)
76
76
  rubocop-rubycw (0.1.6)
77
77
  rubocop (~> 1.0)
@@ -80,7 +80,7 @@ GEM
80
80
  ruby-progressbar (1.11.0)
81
81
  singleton (0.1.1)
82
82
  stackprof (0.2.19)
83
- stringio (3.0.1)
83
+ stringio (3.0.2)
84
84
  strong_json (2.1.2)
85
85
  tempfile (0.1.2)
86
86
  test-unit (3.5.3)
@@ -114,4 +114,4 @@ DEPENDENCIES
114
114
  test-unit
115
115
 
116
116
  BUNDLED WITH
117
- 2.2.32
117
+ 2.3.14
data/Rakefile CHANGED
@@ -54,48 +54,16 @@ task :test_doc do
54
54
  end
55
55
 
56
56
  task :validate => :compile do
57
+ require 'yaml'
58
+
57
59
  sh "#{ruby} #{rbs} validate --silent"
58
60
 
59
61
  FileList["stdlib/*"].each do |path|
60
62
  lib = [File.basename(path).to_s]
61
-
62
- if lib == ["bigdecimal-math"]
63
- lib << "bigdecimal"
64
- end
65
-
66
- if lib == ["yaml"]
67
- lib << "dbm"
68
- lib << "pstore"
69
- end
70
-
71
- if lib == ["logger"]
72
- lib << "monitor"
73
- end
74
-
75
- if lib == ["cgi"]
76
- lib << "tempfile"
77
- end
78
-
79
- if lib == ["csv"]
80
- lib << "forwardable"
81
- end
82
-
83
- if lib == ["prime"]
84
- lib << "singleton"
85
- end
86
-
87
- if lib == ["net-http"]
88
- lib << "uri"
89
- lib << "timeout"
90
- end
91
-
92
- if lib == ["resolv"]
93
- lib << "socket"
94
- lib << "timeout"
95
- end
96
-
97
- if lib == ["openssl"]
98
- lib << "socket"
63
+ if File.exist?("#{path}/0/manifest.yaml")
64
+ YAML.load_file("#{path}/0/manifest.yaml")["dependencies"].each do |dep|
65
+ lib << dep["name"]
66
+ end
99
67
  end
100
68
 
101
69
  sh "#{ruby} #{rbs} #{lib.map {|l| "-r #{l}"}.join(" ")} validate --silent"
data/Steepfile CHANGED
@@ -3,9 +3,13 @@ D = Steep::Diagnostic
3
3
  target :lib do
4
4
  signature "sig"
5
5
  check "lib"
6
- ignore "lib/rbs/prototype", "lib/rbs/test", "lib/rbs/test.rb"
6
+ ignore(
7
+ "lib/rbs/prototype/runtime.rb",
8
+ "lib/rbs/test",
9
+ "lib/rbs/test.rb"
10
+ )
7
11
 
8
- library "set", "pathname", "json", "logger", "monitor", "tsort", "uri"
12
+ library "set", "pathname", "json", "logger", "monitor", "tsort", "uri", 'yaml', 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest'
9
13
  signature "stdlib/strscan/0/"
10
14
  signature "stdlib/rubygems/0/"
11
15
  signature "stdlib/optparse/0/"
data/core/constants.rbs CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # See ARGF (the class) for more details.
6
6
  #
7
- ::ARGF: Object
7
+ ::ARGF: RBS::Unnamed::ARGFClass
8
8
 
9
9
  # <!-- rdoc-file=ruby.c -->
10
10
  # ARGV contains the command line arguments used to run ruby.