AaronC81 / sord

Convert YARD docs to Sorbet RBI and Ruby 3/Steep RBS files
https://sord.aaronc.cc
MIT License
304 stars 18 forks source link

[ERROR] The `SortedSet` class has been extracted from the `set` library. #175

Open wilsonsilva opened 11 months ago

wilsonsilva commented 11 months ago

Describe the bug When I run budle exec sord lib/nostr/client.rb I get this error:

[INFO ] Running YARD...
[DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env` (called at /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/exe/sord:60)
Files:          25
Modules:         6 (    0 undocumented)
Classes:        19 (    0 undocumented)
Constants:      18 (    0 undocumented)
Attributes:     21 (    0 undocumented)
Methods:        48 (    0 undocumented)
 100.00% documented
[ERROR] The `SortedSet` class has been extracted from the `set` library. You must use the `sorted_set` gem or other alternatives.
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/set/sorted_set.rb:4:in `rescue in <top (required)>'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/set/sorted_set.rb:1:in `<top (required)>'
         <internal:/Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
         <internal:/Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/resolver.rb:43:in `const_get'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/resolver.rb:43:in `block in builtin_classes'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/resolver.rb:43:in `select'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/resolver.rb:43:in `builtin_classes'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/resolver.rb:78:in `resolvable?'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/type_converter.rb:127:in `yard_to_sorbet'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/type_converter.rb:114:in `block in yard_to_sorbet'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/type_converter.rb:114:in `map'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/type_converter.rb:114:in `yard_to_sorbet'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:239:in `block in add_methods'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:127:in `each'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:127:in `add_methods'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:269:in `add_namespace'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:272:in `block in add_namespace'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:272:in `each'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:272:in `add_namespace'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:286:in `block in generate'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:286:in `each'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:286:in `generate'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/lib/sord/rbi_generator.rb:302:in `run'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/sord-0.8.0/exe/sord:71:in `block (2 levels) in <top (required)>'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/runner.rb:61:in `run!'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
         /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/commander-4.6.0/lib/commander/import.rb:7:in `block in <top (required)>'

To Reproduce

  1. Clone nostr v0.5.0
  2. Add sord do the gemspec spec.add_development_dependency 'sord', '~> 0.7'
  3. Run bundle install
  4. cd into the gem's folder
  5. Run bundle exec sord lib/nostr/client.rb

Expected behavior

I would expect to get some sort of RBI/RBS file

Actual behavior

I get an error.

Additional information

ruby -v => ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] gem -v => 3.4.20 bundler -v => Bundler version 2.4.7 gem environment =>

RubyGems Environment:
  - RUBYGEMS VERSION: 3.4.20
  - RUBY VERSION: 3.2.2 (2023-03-30 patchlevel 53) [arm64-darwin22]
  - INSTALLATION DIRECTORY: /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0
  - USER INSTALLATION DIRECTORY: /Users/wilson/.gem/ruby/3.2.0
  - RUBY EXECUTABLE: /Users/wilson/.asdf/installs/ruby/3.2.2/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /Users/wilson/.asdf/installs/ruby/3.2.2/bin
  - SPEC CACHE DIRECTORY: /Users/wilson/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/wilson/.asdf/installs/ruby/3.2.2/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-22
  - GEM PATHS:
     - /Users/wilson/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0
     - /Users/wilson/.gem/ruby/3.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.org/"]
     - "install" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/wilson/.asdf/installs/ruby/3.2.2/bin
     - /Users/wilson/.local/share/fig/plugins/git-open
     - /opt/homebrew/opt/bison/bin
     - /Users/wilson/.wasmtime/bin
     - /usr/local/opt/openjdk/bin
     - /Users/wilson/.asdf/shims
     - /opt/homebrew/opt/asdf/libexec/bin
     - /Library/Frameworks/Python.framework/Versions/3.11/bin
     - /Applications/Sublime Text.app/Contents/SharedSupport/bin
     - /Applications/Sublime Text.app/Contents/SharedSupport/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /System/Cryptexes/App/usr/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
     - /Library/Apple/usr/bin
     - /usr/local/MacGPG2/bin
     - /Applications/Little Snitch.app/Contents/Components
     - /usr/local/go/bin
     - /Users/wilson/.cargo/bin
     - /Users/wilson/.fig/bin
     - /Users/wilson/.local/bin
     - /Users/wilson/Library/Android/sdk/tools
     - /Users/wilson/Library/Android/sdk/platform-tools
     - /Users/wilson/.pub-cache/bin