Sorbet confguration

From wikinotes

Locations

sorbet/config config
sorbet/rbi/shims/*.rbi add your own custom stubs

Shims

In addition to ruby tapioca, you can write your own shims for your code.

Simply add whatever methods you want sorbet to know about.
Optionally add sigs to them.

Disable sorbet-runtime

You may want to temporarily disable sorbet-runtime for an executable, environment etc.
For example, you may want to run this:

  • in a rails environment initializer
  • in a test to disable runtime checks
  • in an executable (or a stub that loads bundler and starts ruby pry)
require "sorbet-runtime"
T::Configuration.call_validation_error_handler = nil