From 579f3b94b04a181d8a8b9e7d640ec2a3b299fd25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Aug 2026 02:06:34 +0000 Subject: [PATCH 1/2] bundle update --- Gemfile.lock | 32 ++++++++++++++++---------------- steep/Gemfile.lock | 18 +++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index de5569be0b..bdfdbbf71a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/soutaro/steep.git - revision: 727014c361ae996a80b87948510c83ca480f5e82 + revision: 35bb7dc667a709d999105fe78b534b819afef6d7 specs: - steep (2.1.0.dev) + steep (2.1.0.dev.1) concurrent-ruby (>= 1.1.10) csv (>= 3.0.9) fileutils (>= 1.1.0) @@ -55,14 +55,14 @@ GEM benchmark (0.5.0) benchmark-ips (2.15.1) bigdecimal (4.1.2) - concurrent-ruby (1.3.6) + concurrent-ruby (1.3.8) connection_pool (3.0.2) - csv (3.3.5) + csv (3.3.6) dbm (1.1.0) diff-lcs (1.6.2) digest (3.2.1) drb (2.2.3) - erb (6.0.6) + erb (6.0.7) extconf_compile_commands_json (0.0.7) ffi (1.17.4) fileutils (1.8.0) @@ -71,19 +71,19 @@ GEM psych (>= 3.1, < 5.0) rainbow (>= 3.0, < 4.0) strong_json (>= 1.1, < 2.2) - i18n (1.14.8) + i18n (1.15.2) concurrent-ruby (~> 1.0) - io-console (0.8.2) + io-console (0.9.1) irb (1.18.0) pp (>= 0.6.0) prism (>= 1.3.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.19.7) + json (2.21.2) json-schema (6.2.0) addressable (~> 2.8) bigdecimal (>= 3.1, < 5) - language_server-protocol (3.17.0.5) + language_server-protocol (3.17.0.6) lint_roller (1.1.0) listen (3.10.0) logger @@ -101,14 +101,14 @@ GEM timeout net-smtp (0.5.1) net-protocol - nkf (0.2.0) + nkf (0.3.0) ostruct (0.6.3) parallel (2.1.0) - parser (3.3.11.1) + parser (3.3.12.0) ast (~> 2.4.1) racc power_assert (3.0.1) - pp (0.6.3) + pp (0.6.4) prettyprint prettyprint (0.2.0) prism (1.9.0) @@ -134,7 +134,7 @@ GEM rbs (>= 4.0.0) tsort regexp_parser (2.12.0) - reline (0.6.3) + reline (0.7.0) io-console (~> 0.5) rspec (3.13.2) rspec-core (~> 3.13.0) @@ -149,7 +149,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.7) - rubocop (1.87.0) + rubocop (1.89.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -160,7 +160,7 @@ GEM rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.49.1) + rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) rubocop-on-rbs (2.0.0) @@ -180,7 +180,7 @@ GEM tempfile (0.3.1) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.7) + test-unit (3.7.8) power_assert timeout (0.6.1) tsort (0.2.0) diff --git a/steep/Gemfile.lock b/steep/Gemfile.lock index 702ce9138c..59d2105443 100644 --- a/steep/Gemfile.lock +++ b/steep/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (8.1.3) + activesupport (8.1.3.1) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -17,16 +17,16 @@ GEM ast (2.4.3) base64 (0.3.0) bigdecimal (4.1.2) - concurrent-ruby (1.3.6) + concurrent-ruby (1.3.8) connection_pool (3.0.2) - csv (3.3.5) + csv (3.3.6) drb (2.2.3) ffi (1.17.4) fileutils (1.8.0) - i18n (1.14.8) + i18n (1.15.2) concurrent-ruby (~> 1.0) - json (2.19.9) - language_server-protocol (3.17.0.5) + json (2.21.2) + language_server-protocol (3.17.0.6) listen (3.10.0) logger rb-fsevent (~> 0.10, >= 0.10.3) @@ -36,7 +36,7 @@ GEM drb (~> 2.0) prism (~> 1.5) mutex_m (0.3.0) - parser (3.3.11.1) + parser (3.3.12.0) ast (~> 2.4.1) racc power_assert (3.0.1) @@ -49,7 +49,7 @@ GEM rbs (3.10.4) logger tsort - ruby-lsp (0.26.9) + ruby-lsp (0.26.10) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) rbs (>= 3, < 5) @@ -74,7 +74,7 @@ GEM strscan (3.1.8) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.7) + test-unit (3.7.8) power_assert tsort (0.2.0) tzinfo (2.0.6) From 373739a04eb3c6a46ba8120c4f1e28b11896e90b Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Mon, 10 Aug 2026 11:53:06 +0900 Subject: [PATCH 2/2] Allow specifying signature paths for test generation --- Rakefile | 12 +++++------- docs/CONTRIBUTING.md | 2 +- docs/stdlib.md | 8 ++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 387533ed23..f1b4dab9bb 100644 --- a/Rakefile +++ b/Rakefile @@ -325,15 +325,11 @@ namespace :generate do class TestTemplateBuilder attr_reader :target, :env - def initialize(target) + def initialize(target, paths:) @target = target loader = RBS::EnvironmentLoader.new - Dir['stdlib/*'].each do |lib| - next if lib.end_with?('builtin') - - loader.add(library: File.basename(lib)) - end + paths.each { loader.add(path: Pathname(_1)) } @env = RBS::Environment.from_loader(loader).resolve_type_names end @@ -425,7 +421,7 @@ namespace :generate do end end - path.write TestTemplateBuilder.new(target).call + path.write TestTemplateBuilder.new(target, paths: args.extras).call puts "Created: #{path}" end @@ -436,6 +432,8 @@ task :test_generate_stdlib do sh "ruby -c /tmp/Array_test.rb" sh "RBS_GENERATE_TEST_PATH=/tmp/Thread_Mutex_test.rb rake 'generate:stdlib_test[Thread::Mutex]'" sh "ruby -c /tmp/Thread_Mutex_test.rb" + sh "RBS_GENERATE_TEST_PATH=/tmp/Kconv_test.rb rake 'generate:stdlib_test[Kconv,stdlib/nkf/0,stdlib/kconv/0]'" + sh "ruby -c /tmp/Kconv_test.rb" end # Pull requests with one of these labels are omitted from the changelog. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 250b50c2a3..a6d970ea18 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -33,7 +33,7 @@ You will typically follow the steps as follows: 1. Run `rbs prototype runtime` to generate list of methods. 2. Run `rbs annotate` to import RDoc comments. -3. Run `rake generate:stdlib_test[LIB]` to generate a test case. +3. Run `rake generate:stdlib_test[CLASS,PATH,...]` to generate a test case. Pass the paths to the standard library signatures and their dependencies when needed. 4. Write the type definitions and tests. See the next *Useful Tools* section and the guides above for writing and testing RBS files. diff --git a/docs/stdlib.md b/docs/stdlib.md index 3a5a76d1ff..ce974c2007 100644 --- a/docs/stdlib.md +++ b/docs/stdlib.md @@ -15,6 +15,14 @@ $ bundle exec rake 'generate:stdlib_test[String]' Created: test/stdlib/String_test.rb ``` +Core signatures are loaded by default. To generate a test for a class defined in standard library signatures, +pass the paths containing those signatures and their dependencies after the class name. + +```console +$ bundle exec rake 'generate:stdlib_test[CSV::Row,stdlib/csv/0,stdlib/forwardable/0]' +Created: test/stdlib/CSV_Row_test.rb +``` + It generates `test/stdlib/[class_name]_test.rb`. The test scripts would look like the following: