- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 408
Closed
Labels
Description
Sorbet, a ruby type-checking library, is initialized by calling srb init
(and definitions are updated with srb rbi hidden-definitions
). These commands throw errors due to Kernel#exit
being called from Yard when yard is required by sorbet, which happens when yard
is in a project's Gemfile.
I also opened a question on StackOverflow.
Not calling exit
on load seems to be a known requirement for using sorbet, see sorbet/sorbet#1476
I haven't had a chance to dig into the yard code and locate the specific #exit
call that is causing the error or see if there's an easy workaround. If there's interest I'm happy to investigate a fix and would appreciate any direction/pointers.
Steps to reproduce
- Create new rails app (
rails new test_app
) - Add yard and sorbet gems to Gemfile
gem 'yard'
gem 'sorbet', :group => :development
gem 'sorbet-runtime'
- Bundle install and initialize sorbet
bundle install
bundle exec srb init
Actual Output
Generating: sorbet/config
Reusing existing config file: sorbet/config
Generating: sorbet/rbi/sorbet-typed/
Generating: sorbet/rbi/gems/
NameError: uninitialized constant ActionController::Middleware
Did you mean? ActionController::MiddlewareStack
LoadError: Generating image variants require the image_processing gem. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.
LoadError: cannot load such file -- webrobots
LoadError: cannot load such file -- rack/session/dalli
LoadError: cannot load such file -- railties
LoadError: Function 'inotify_init' not found in [libc.dylib]
LoadError: cannot load such file -- sorbet
LoadError: cannot load such file -- sorbet-static
LoadError: cannot load such file -- spring
LoadError: cannot load such file -- sprockets-rails
LoadError: cannot load such file -- turbolinks-source
Generating: sorbet/rbi/hidden-definitions/
Requiring all of your code
Naming all Modules
Naming ActionController::RequestForgeryProtection::ProtectionMethods::NullSessioNaming ActionController::RequestForgeryProtection::ProtectionMethods::NullSessioNaming ActionController::RequestForgeryProtection::ProtectionMethods::NullSessioNaming ActionController::RequestForgeryProtection::ProtectionMethods::ResetSessiNaming ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimNaming ActionDispatch::SessionYou don't have dalli installed in your application. Please add it to your Gemfile and run bundle install
Got LoadError when trying to get nested name ActionDispatch::Session::MemCacheStore
Naming ActionMailbox::Ingresses::Mandrill::InboundEmailsController::AuthenticatoNaming ActiveJob::QueueAdaptersGot LoadError when trying to get nested name ActiveJob::QueueAdapters::SneakersAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::SuckerPunchAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::BackburnerAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::DelayedJobAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::QueAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::QueueClassicAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::ResqueAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::SidekiqAdapter
Naming ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue::BiasedCoNaming ActiveStorage::TransformersGot LoadError when trying to get nested name ActiveStorage::Transformers::ImageProcessingTransformer
Naming ActiveSupport::CacheThe Redis cache store requires the redis gem, version 4.0.1 or later. Please add it to your Gemfile: `gem "redis", "~> 4.0"`
Got Gem::LoadError when trying to get nested name ActiveSupport::Cache::RedisCacheStore
You don't have dalli installed in your application. Please add it to your Gemfile and run bundle install
Got LoadError when trying to get nested name ActiveSupport::Cache::MemCacheStore
Naming I18n/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77: warning: constant I18n::INTERPOLATION_PATTERN is deprecated
Naming I18n::TestsGot ArgumentError when trying to get nested name I18n::Tests::Pluralization_
Got ArgumentError when trying to get nested name I18n::Tests::Procs_
Got ArgumentError when trying to get nested name I18n::Tests::Basics_
Got ArgumentError when trying to get nested name I18n::Tests::Defaults_
Got ArgumentError when trying to get nested name I18n::Tests::Interpolation_
Got ArgumentError when trying to get nested name I18n::Tests::Link_
Got ArgumentError when trying to get nested name I18n::Tests::Lookup_
Naming I18n::Tests::LocalizationGot ArgumentError when trying to get nested name I18n::Tests::Localization::Procs_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::DateTime_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::Time_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::Date_
Naming Loofah::HTML5/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77: warning: constant Loofah::HTML5::WhiteList is deprecated
Naming Mail::Parsers::ContentTransferEncodingParser::ContentTransferEncodingStruNaming Net/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77: warning: constant Net::HTTPServerException is deprecated
Naming Rack::HandlerGot LoadError when trying to get nested name Rack::Handler::LSWS
Got LoadError when trying to get nested name Rack::Handler::SCGI
Got LoadError when trying to get nested name Rack::Handler::Thin
Got LoadError when trying to get nested name Rack::Handler::FastCGI
Naming Rack::Request/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77: warning: constant Rack::Request::SCHEME_WHITELIST is deprecated
Naming Rack::SessionGot LoadError when trying to get nested name Rack::Session::Memcache
Naming Rails::ApplicationGot NameError when trying to get nested name Rails::Application::Railties_
Naming Selenium::WebDriverGot LoadError when trying to get nested name Selenium::WebDriver::PhantomJS
Naming Sprockets::AutoloadGot LoadError when trying to get nested name Sprockets::Autoload::Closure
Got LoadError when trying to get nested name Sprockets::Autoload::Babel
Got LoadError when trying to get nested name Sprockets::Autoload::CoffeeScript
Got LoadError when trying to get nested name Sprockets::Autoload::Eco
Got LoadError when trying to get nested name Sprockets::Autoload::EJS
Got LoadError when trying to get nested name Sprockets::Autoload::JSMinC
Got LoadError when trying to get nested name Sprockets::Autoload::Sass
Got LoadError when trying to get nested name Sprockets::Autoload::Uglifier
Got LoadError when trying to get nested name Sprockets::Autoload::YUI
Got LoadError when trying to get nested name Sprockets::Autoload::Zopfli
Naming Struct/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77: warning: constant Struct::Tms is deprecated
Naming TiltGot LoadError when trying to get nested name Tilt::WikiClothTemplate
Got LoadError when trying to get nested name Tilt::YajlTemplate
Got LoadError when trying to get nested name Tilt::ErubisTemplate
Got LoadError when trying to get nested name Tilt::BlueClothTemplate
Got LoadError when trying to get nested name Tilt::MarukuTemplate
Got LoadError when trying to get nested name Tilt::KramdownTemplate
Got LoadError when trying to get nested name Tilt::RDiscountTemplate
Got LoadError when trying to get nested name Tilt::RedcarpetTemplate
Got LoadError when trying to get nested name Tilt::CommonMarkerTemplate
Got LoadError when trying to get nested name Tilt::PandocTemplate
Got LoadError when trying to get nested name Tilt::AsciidoctorTemplate
Got LoadError when trying to get nested name Tilt::BabelTemplate
Got LoadError when trying to get nested name Tilt::CoffeeScriptTemplate
Got LoadError when trying to get nested name Tilt::CoffeeScriptLiterateTemplate
Got LoadError when trying to get nested name Tilt::CreoleTemplate
Got LoadError when trying to get nested name Tilt::HamlTemplate
Got LoadError when trying to get nested name Tilt::LessTemplate
Got LoadError when trying to get nested name Tilt::LiquidTemplate
Got LoadError when trying to get nested name Tilt::LiveScriptTemplate
Got LoadError when trying to get nested name Tilt::MarkabyTemplate
Got LoadError when trying to get nested name Tilt::PrawnTemplate
Got LoadError when trying to get nested name Tilt::RadiusTemplate
Got LoadError when trying to get nested name Tilt::RedClothTemplate
Got LoadError when trying to get nested name Tilt::RstPandocTemplate
Got LoadError when trying to get nested name Tilt::TypeScriptTemplate
Naming WebConsoleGot NameError when trying to get nested name WebConsole::SourceLocation_
Naming YARD::Handlers::Ruby::Legacy/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/parser/ruby/legacy/irb/slex.rb:18: warning: already initialized constant IRB::SLex::DOUT
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/2.6.0/irb/slex.rb:24: warning: previous definition of DOUT was here
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/parser/ruby/legacy/irb/slex.rb:19: warning: already initialized constant IRB::SLex::D_WARN
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/2.6.0/irb/slex.rb:25: warning: previous definition of D_WARN was here
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/parser/ruby/legacy/irb/slex.rb:20: warning: already initialized constant IRB::SLex::D_DEBUG
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/2.6.0/irb/slex.rb:26: warning: previous definition of D_DEBUG was here
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/parser/ruby/legacy/irb/slex.rb:21: warning: already initialized constant IRB::SLex::D_DETAIL
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/2.6.0/irb/slex.rb:27: warning: previous definition of D_DETAIL was here
Naming YARD::Server::Commands::SearchCommandKernel#exit was called while requiring ruby source files
Naming YARD::Server::Commands::StaticFileHelpersTraceback (most recent call last):
51: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/bin/srb-rbi:237:in `<main>'
50: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/bin/srb-rbi:196:in `main'
49: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/bin/srb-rbi:121:in `init'
48: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/bin/srb-rbi:232:in `block in make_step'
47: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:38:in `main'
46: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:44:in `main'
45: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:75:in `all_modules_and_aliases'
44: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:68:in `constant_cache'
43: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/gem-generator-tracepoint/tracer.rb:40:in `new'
42: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/gem-generator-tracepoint/tracer.rb:40:in `new'
41: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:70:in `initialize'
40: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `dfs_module'
39: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `each'
38: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:212:in `block in dfs_module'
37: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `dfs_module'
36: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `each'
35: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:212:in `block in dfs_module'
34: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `dfs_module'
33: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:211:in `each'
32: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:212:in `block in dfs_module'
31: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:145:in `dfs_module'
30: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:145:in `each'
29: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/constant_cache.rb:157:in `block in dfs_module'
28: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77:in `real_const_get'
27: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77:in `call'
26: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/real_stdlib.rb:77:in `const_get'
25: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
24: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
23: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
22: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
21: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
20: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
19: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/list_command.rb:2:in `<main>'
18: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/list_command.rb:3:in `<module:YARD>'
17: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/list_command.rb:4:in `<module:Server>'
16: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/list_command.rb:6:in `<module:Commands>'
15: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
14: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
13: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
12: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
11: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
10: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
9: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:4:in `<main>'
8: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:5:in `<module:YARD>'
7: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:6:in `<module:Server>'
6: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:32:in `<module:Commands>'
5: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:34:in `<class:LibraryCommand>'
4: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:8:in `fork'
3: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:8:in `fork'
2: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:10:in `block in fork'
1: from /Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/yard-0.9.26/lib/yard/server/commands/library_command.rb:34:in `block in <class:LibraryCommand>'
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/require_everything.rb:94:in `block in patch_kernel': ExitCalledError (ExitCalledError)
Naming RDoc::MarkupGot NameError when trying to get nested name RDoc::Markup::TextFormatterTestCase_
Got NameError when trying to get nested name RDoc::Markup::FormatterTestCase_
Generating /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/reflection.rbi with 5346 modules and 136 aliases
Printing your code's symbol table into /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/from-source.json
Printing /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/reflection.rbi's symbol table into /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/reflection.json
Reading /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/from-source.json
Reading /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/reflection.json
Building rbi id to symbol map
Building source id to symbol map
Writing /var/folders/b9/kw3hfc7x4hsf6v9yn9vd5k7h0000gn/T/d20210909-17528-1at0a3f/hidden.rbi.tmp
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:224: warning: constant ::Data is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:224: warning: constant ::Data is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:328: warning: constant I18n::INTERPOLATION_PATTERN is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:328: warning: constant Loofah::HTML5::WhiteList is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:224: warning: constant Net::HTTPServerException is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:224: warning: constant Net::HTTPServerException is deprecated
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:328: warning: constant Rack::Request::SCHEME_WHITELIST is deprecated
2021-09-09 17:11:48 WARN Selenium [DEPRECATION] Selenium::WebDriver::Error::ScriptTimeOutError is deprecated. Use Selenium::WebDriver::Error::ScriptTimeoutError (ensure the driver supports W3C WebDriver specification) instead.
2021-09-09 17:11:48 WARN Selenium [DEPRECATION] Selenium::WebDriver::Error::ScriptTimeOutError is deprecated. Use Selenium::WebDriver::Error::ScriptTimeoutError (ensure the driver supports W3C WebDriver specification) instead.
2021-09-09 17:11:48 WARN Selenium [DEPRECATION] Selenium::WebDriver::Error::TimeOutError is deprecated. Use Selenium::WebDriver::Error::TimeoutError (ensure the driver supports W3C WebDriver specification) instead.
2021-09-09 17:11:48 WARN Selenium [DEPRECATION] Selenium::WebDriver::Error::TimeOutError is deprecated. Use Selenium::WebDriver::Error::TimeoutError (ensure the driver supports W3C WebDriver specification) instead.
/Users/grahammelcher/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sorbet-0.5.9115/lib/hidden-definition-finder.rb:328: warning: constant Struct::Tms is deprecated
Generating split RBIs into sorbet/rbi/hidden-definitions/
Generating: sorbet/rbi/todo.rbi
✅ Done!
This project is now set up for use with Sorbet. The sorbet/ folder should exist
and look something like this:
sorbet/
├── config # Default options to be passed to sorbet on every run
└── rbi/
├── sorbet-typed/ # Community written type definition files for your gems
├── gems/ # Autogenerated type definitions for your gems (from reflection)
├── hidden-definitions/ # All definitions that exist at runtime, but Sorbet couldn't see statically
└── todo.rbi # Constants which were still missing, even after the three steps above.
Please check this whole folder into version control.
➡️ What's next?
Up to you! First things first, you'll probably want to typecheck your project:
srb tc
Other than that, it's up to you!
We recommend skimming these docs to get a feel for how to use Sorbet:
- Gradual Type Checking (https://sorbet.org/docs/gradual)
- Enabling Static Checks (https://sorbet.org/docs/static)
- RBI Files (https://sorbet.org/docs/rbi)
If instead you want to explore your files locally, here are some things to try:
- Upgrade a file marked # typed: false to # typed: true.
Then, run srb tc and try to fix any errors.
- Add signatures to your methods with `sig`.
For how, read: https://sorbet.org/docs/sigs
- Check whether things that show up in the TODO RBI file actually exist in your project.
It's possible some of these constants are typos.
- Upgrade a file marked # typed: ignore to # typed: false.
Then, run srb rbi hidden-definitions && srb tc and try to fix any errors.
🙌 Please don't hesitate to give us your feedback!
Expected Output
That srb init
does not throw an error.
Environment details:
- OS: OSX 11.5.2
- Ruby version (
ruby -v
): ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18] - YARD version (
yard -v
): yard 0.9.26 - Relevant software dependency/versions:
- sorbet version: Sorbet typechecker 0.5.9115 git 8f3401b99e7a5210b845d876cf52eccd2e1ce4c5 debug_symbols=true clean=1
I have read the Contributing Guide.
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
lsegal commentedon Sep 10, 2021
This definitely seems like something that should be first opened against Sorbet. YARD isn't calling exit in the main process, but in a forked process. There's no real reason why Sorbet should fail here, since the main process is still running.
Seems like a case of an over-vigilant executor, something that Sorbet should be handling more gracefully (i.e., not throwing an exception just because exit was called).
That said, YARD can workaround this and will because it's a super easy fix, but we shouldn't need to.
okhwaja commentedon Oct 19, 2021
Hi @lsegal , thanks for merging the workaround for this! Would you be open to doing a new release so we could pick up the change? thanks!
Handle over-vigilant Sorbet parser