Skip to content

Commit 1603ea6

Browse files
authored
Merge branch 'master' into kconv
2 parents 4416629 + 64a96b1 commit 1603ea6

File tree

19 files changed

+340
-23
lines changed

19 files changed

+340
-23
lines changed

.github/workflows/ruby.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
job: lexer compile confirm_lexer
3333
- ruby: "3.3"
3434
job: rubocop validate test_doc build test_generate_stdlib raap
35+
- ruby: "3.3"
36+
job: typecheck_test
3537
steps:
3638
- uses: actions/checkout@v4
3739
- uses: ruby/setup-ruby@v1
@@ -64,6 +66,10 @@ jobs:
6466
echo "NO_MINITEST=true" >> $GITHUB_ENV
6567
bundle config set --local without 'minitest'
6668
if: ${{ contains(matrix.ruby, 'head') }}
69+
- name: Skip installing type checkers
70+
if: ${{ ! contains(matrix.job, 'typecheck_test') }}
71+
run: |
72+
bundle config set without 'typecheck_test'
6773
- name: bin/setup
6874
run: |
6975
bin/setup

CHANGELOG.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,107 @@
11
# CHANGELOG
22

3-
## master
3+
## 3.5.0 (2024-06-06)
4+
5+
### Signature updates
6+
7+
* `net-http` headers ([#1750](https://github.com/ruby/rbs/pull/1750))
8+
* `CSV.foreach` ([#1738](https://github.com/ruby/rbs/pull/1738))
9+
* `Enumerator#initialize` ([#1801](https://github.com/ruby/rbs/pull/1801))
10+
* `Float#divmod`, `Rational#divmod` ([#1868](https://github.com/ruby/rbs/pull/1868))
11+
* `GC` ([#1530](https://github.com/ruby/rbs/pull/1530))
12+
* `Integer#pow` ([#1706](https://github.com/ruby/rbs/pull/1706))
13+
* `Kernel.rand` ([#1783](https://github.com/ruby/rbs/pull/1783))
14+
* `Kernel#extend` ([#1769](https://github.com/ruby/rbs/pull/1769))
15+
* `Module#include`, `Module#prepend` ([#1769](https://github.com/ruby/rbs/pull/1769))
16+
* `Proc#parameters` ([#1819](https://github.com/ruby/rbs/pull/1819))
17+
* `Range#step` ([#1709](https://github.com/ruby/rbs/pull/1709))
18+
* `Regexp.union` ([#1809](https://github.com/ruby/rbs/pull/1809))
19+
* `RubyVM::YJIT.enable` ([#1812](https://github.com/ruby/rbs/pull/1812))
20+
* `RubyVM::YJIT`, `RubyVM::RJIT` ([#1746](https://github.com/ruby/rbs/pull/1746))
21+
* `String#bytesplice` ([#1793](https://github.com/ruby/rbs/pull/1793))
22+
* `String#gsub!` ([#1768](https://github.com/ruby/rbs/pull/1768))
23+
* `Symbol#=~` ([#1704](https://github.com/ruby/rbs/pull/1704))
24+
* `Time#initialize` ([#1771](https://github.com/ruby/rbs/pull/1771))
25+
* `Time#zone` ([#1770](https://github.com/ruby/rbs/pull/1770))
26+
* `Timeout::ExitException` ([#1803](https://github.com/ruby/rbs/pull/1803))
27+
* `URI::MailTo` ([#1858](https://github.com/ruby/rbs/pull/1858))
28+
* Update docs ([#1811](https://github.com/ruby/rbs/pull/1811), [#1699](https://github.com/ruby/rbs/pull/1699))
29+
30+
### Language updates
31+
32+
* Fix proc type syntax ([#1807](https://github.com/ruby/rbs/pull/1807))
33+
* Function types with untyped parameter ([#1806](https://github.com/ruby/rbs/pull/1806))
34+
* Fix record type ([#1732](https://github.com/ruby/rbs/pull/1732))
35+
* parser: enable record types with optional fields ([#1717](https://github.com/ruby/rbs/pull/1717))
36+
37+
### Library changes
38+
39+
* Drop dependency on `abbrev` ([#1866](https://github.com/ruby/rbs/pull/1866))
40+
* Fix source display ([#1832](https://github.com/ruby/rbs/pull/1832))
41+
* Include trivia tokens to lex result ([#1831](https://github.com/ruby/rbs/pull/1831))
42+
* Implement token list API ([#1829](https://github.com/ruby/rbs/pull/1829))
43+
* Fix memory leak when ParsingError ([#1830](https://github.com/ruby/rbs/pull/1830))
44+
* [rbs diff] Fix error when empty manifest.yaml ([#1762](https://github.com/ruby/rbs/pull/1762))
45+
* Remove deprecated API since RBS v1 ([#1805](https://github.com/ruby/rbs/pull/1805))
46+
* Use array instead of linked list for rbs location's child ([#1786](https://github.com/ruby/rbs/pull/1786))
47+
* Fix SEGV with parse negative position ([#1790](https://github.com/ruby/rbs/pull/1790))
48+
* Add location for attribute ([#1787](https://github.com/ruby/rbs/pull/1787))
49+
* Always be private ([#1774](https://github.com/ruby/rbs/pull/1774))
50+
* Prevent resource leak with type/method-type parser when reaching EOF. ([#1742](https://github.com/ruby/rbs/pull/1742))
51+
* Allow loading RBS from different version of a gem ([#1731](https://github.com/ruby/rbs/pull/1731))
52+
* Fix method name tag on assertion ([#1705](https://github.com/ruby/rbs/pull/1705))
53+
* Improve interface check by method parameters ([#1698](https://github.com/ruby/rbs/pull/1698))
54+
55+
#### rbs prototype
56+
57+
* Fix prototype for ruby-3.4 ([#1760](https://github.com/ruby/rbs/pull/1760))
58+
* Fix 3.4 `prototype rb` failure ([#1713](https://github.com/ruby/rbs/pull/1713))
59+
* Add Numeric Node's check for parse rbs ([#1711](https://github.com/ruby/rbs/pull/1711))
60+
61+
#### rbs collection
62+
63+
* Fix RBS loading precedence ([#1720](https://github.com/ruby/rbs/pull/1720))
64+
* Refactor Git source by using `git?` method ([#1701](https://github.com/ruby/rbs/pull/1701))
65+
66+
### Miscellaneous
67+
68+
* Introduce RaaP for testing of signature ([#1810](https://github.com/ruby/rbs/pull/1810))
69+
* Revise .gemspec to remove `Gemfile` and `Gemfile.lock` ([#1856](https://github.com/ruby/rbs/pull/1856))
70+
* Add link to gem_rbs_collection to README ([#1827](https://github.com/ruby/rbs/pull/1827))
71+
* Remove `Gemfile.lock` from the gem package ([#1823](https://github.com/ruby/rbs/pull/1823))
72+
* Modify template to use TestHelper ([#1776](https://github.com/ruby/rbs/pull/1776))
73+
* Should focus on `String.new` not `String#initialize`. ([#1789](https://github.com/ruby/rbs/pull/1789))
74+
* Make the test suite compatible with `--enable-frozen-string-literal` ([#1767](https://github.com/ruby/rbs/pull/1767))
75+
* Stop reusing `fd` ([#1752](https://github.com/ruby/rbs/pull/1752))
76+
* Fix test failures on Ruby 3.4 ([#1734](https://github.com/ruby/rbs/pull/1734))
77+
* Stop trace object allocations during test ([#1724](https://github.com/ruby/rbs/pull/1724))
78+
* Fix head test fails ([#1719](https://github.com/ruby/rbs/pull/1719))
79+
80+
## 3.4.4 (2024-02-08)
81+
82+
### Miscellaneous
83+
84+
* Backport [#1752](https://github.com/ruby/rbs/pull/1752) ([#1753](https://github.com/ruby/rbs/pull/1753))
85+
86+
## 3.4.3 (2024-01-25)
87+
88+
### Library changes
89+
90+
#### rbs collection
91+
92+
* Backport [#1731](https://github.com/ruby/rbs/pull/1731) ([#1735](https://github.com/ruby/rbs/pull/1735))
93+
94+
## 3.4.2 (2024-01-19)
95+
96+
### Miscellaneous
97+
98+
* Backport [#1724](https://github.com/ruby/rbs/pull/1724) ([#1726](https://github.com/ruby/rbs/pull/1726))
99+
100+
## 3.4.1 (2023-12-26)
101+
102+
### Signature updates
103+
104+
* Update embedded RDoc based on ruby-3.3.0 (Backport #1699) ([#1700](https://github.com/ruby/rbs/pull/1700))
4105

5106
## 3.4.0 (2023-12-21)
6107

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ gem 'csv'
4040
group :minitest do
4141
gem "minitest"
4242
end
43+
44+
group :typecheck_test do
45+
gem "steep", "~> 1.7.0.dev", require: false
46+
end

Gemfile.lock

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
rbs (3.5.0.pre.2)
5-
abbrev
4+
rbs (3.5.0)
65

76
PATH
87
remote: test/assets/test-gem
@@ -13,26 +12,47 @@ GEM
1312
remote: https://rubygems.org/
1413
specs:
1514
abbrev (0.1.2)
15+
activesupport (7.1.3.4)
16+
base64
17+
bigdecimal
18+
concurrent-ruby (~> 1.0, >= 1.0.2)
19+
connection_pool (>= 2.2.5)
20+
drb
21+
i18n (>= 1.6, < 2)
22+
minitest (>= 5.1)
23+
mutex_m
24+
tzinfo (~> 2.0)
1625
addressable (2.8.6)
1726
public_suffix (>= 2.0.2, < 6.0)
1827
ast (2.4.2)
1928
base64 (0.2.0)
2029
benchmark-ips (2.13.0)
2130
bigdecimal (3.1.8)
31+
concurrent-ruby (1.3.1)
32+
connection_pool (2.4.1)
2233
csv (3.3.0)
2334
dbm (1.1.0)
2435
diff-lcs (1.5.1)
2536
digest (3.1.1)
37+
drb (2.2.1)
38+
ffi (1.17.0)
39+
ffi (1.17.0-x86_64-darwin)
2640
fileutils (1.7.2)
2741
goodcheck (3.1.0)
2842
marcel (>= 1.0, < 2.0)
2943
psych (>= 3.1, < 5.0)
3044
rainbow (>= 3.0, < 4.0)
3145
strong_json (>= 1.1, < 2.2)
46+
i18n (1.14.5)
47+
concurrent-ruby (~> 1.0)
3248
json (2.7.2)
3349
json-schema (4.3.0)
3450
addressable (>= 2.8)
3551
language_server-protocol (3.17.0.3)
52+
listen (3.9.0)
53+
rb-fsevent (~> 0.10, >= 0.10.3)
54+
rb-inotify (~> 0.9, >= 0.9.10)
55+
logger (1.6.0)
3656
marcel (1.0.4)
3757
memory_profiler (1.0.1)
3858
minitest (5.23.1)
@@ -58,6 +78,9 @@ GEM
5878
rake (13.2.1)
5979
rake-compiler (1.2.7)
6080
rake
81+
rb-fsevent (0.11.2)
82+
rb-inotify (0.11.1)
83+
ffi (~> 1.0)
6184
rdoc (6.6.3.1)
6285
psych (>= 4.0.0)
6386
regexp_parser (2.9.2)
@@ -92,14 +115,34 @@ GEM
92115
rubocop-rubycw (0.1.6)
93116
rubocop (~> 1.0)
94117
ruby-progressbar (1.13.0)
118+
securerandom (0.3.1)
95119
stackprof (0.2.26)
120+
steep (1.7.0.dev.4)
121+
activesupport (>= 5.1)
122+
concurrent-ruby (>= 1.1.10)
123+
csv (>= 3.0.9)
124+
fileutils (>= 1.1.0)
125+
json (>= 2.1.0)
126+
language_server-protocol (>= 3.15, < 4.0)
127+
listen (~> 3.0)
128+
logger (>= 1.3.0)
129+
parser (>= 3.1)
130+
rainbow (>= 2.2.2, < 4.0)
131+
rbs (>= 3.5.0.pre)
132+
securerandom (>= 0.1)
133+
strscan (>= 1.0.0)
134+
terminal-table (>= 2, < 4)
96135
stringio (3.1.0)
97136
strong_json (2.1.2)
98137
strscan (3.1.0)
99138
tempfile (0.2.1)
139+
terminal-table (3.0.2)
140+
unicode-display_width (>= 1.1.1, < 3)
100141
test-unit (3.6.2)
101142
power_assert
102143
timeout (0.4.1)
144+
tzinfo (2.0.6)
145+
concurrent-ruby (~> 1.0)
103146
unicode-display_width (2.5.0)
104147

105148
PLATFORMS
@@ -133,6 +176,7 @@ DEPENDENCIES
133176
rubocop
134177
rubocop-rubycw
135178
stackprof
179+
steep (~> 1.7.0.dev)
136180
tempfile
137181
test-unit
138182

Rakefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Rake::TestTask.new(:test => :compile) do |t|
1919
end
2020
end
2121

22-
multitask :default => [:test, :stdlib_test, :rubocop, :validate, :test_doc]
22+
multitask :default => [:test, :stdlib_test, :typecheck_test, :rubocop, :validate, :test_doc]
2323

2424
task :lexer do
2525
sh "re2c -W --no-generation-date -o ext/rbs_extension/lexer.c ext/rbs_extension/lexer.re"
@@ -92,6 +92,19 @@ task :stdlib_test => :compile do
9292
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Encoding_test.rb"
9393
end
9494

95+
task :typecheck_test => :compile do
96+
FileList["test/typecheck/*"].each do |test|
97+
Dir.chdir(test) do
98+
expectations = File.join(test, "steep_expectations.yml")
99+
if File.exist?(expectations)
100+
sh "steep check --with_expectations"
101+
else
102+
sh "steep check"
103+
end
104+
end
105+
end
106+
end
107+
95108
task :raap => :compile do
96109
sh %q[cat test/raap.txt | egrep -v '^#|^$' | xargs bundle exec raap]
97110
end

Steepfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ target :lib do
88
# "lib/rbs/test.rb"
99
)
1010

11-
library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'abbrev', 'prettyprint', 'yaml', "psych", "securerandom"
11+
library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'prettyprint', 'yaml', "psych", "securerandom"
1212
signature "stdlib/strscan/0/"
1313
signature "stdlib/optparse/0/"
1414
signature "stdlib/rdoc/0/"

core/float.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ class Float < Numeric
442442
# 13.0.divmod(4.0) # => [3, 1.0]
443443
# 13.0.divmod(Rational(4, 1)) # => [3, 1.0]
444444
#
445-
def divmod: (Numeric) -> [ Numeric, Numeric ]
445+
def divmod: (Integer | Float | Rational) -> [ Integer, Float ]
446+
| (Numeric) -> [ Numeric, Numeric ]
446447

447448
def dup: () -> self
448449

core/integer.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ class Integer < Numeric
766766
# 13.divmod(Rational(4, 1)) # => [3, (1/1)]
767767
#
768768
def divmod: (Integer) -> [ Integer, Integer ]
769-
| (Float) -> [ Float, Float ]
769+
| (Float) -> [ Integer, Float ]
770+
| (Rational) -> [ Integer, Rational ]
770771
| (Numeric) -> [ Numeric, Numeric ]
771772

772773
# <!--

core/rational.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ class Rational < Numeric
245245

246246
def div: (Numeric) -> Integer
247247

248-
def divmod: (Numeric) -> [ Numeric, Numeric ]
248+
def divmod: (Integer | Float | Rational) -> [ Integer, Rational ]
249+
| (Numeric) -> [ Numeric, Numeric ]
249250

250251
def dup: () -> self
251252

docs/gem.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Assume you have three RBS files in your gem package:
3131

3232
```yaml
3333
dependencies:
34-
- name: abbrev
3534
- name: json
3635
- name: logger
3736
- name: optparse

0 commit comments

Comments
 (0)