Convert YARD docs to Sorbet RBI and Ruby 3/Steep RBS files

29-Dec-2020 2415
Sord is a Sorbet and YARD crossover. It can automatically generate RBI and RBS type signature files by looking at the types specified in YARD documentation comments.If your project is already YARD documented, then this can generate most of the type signatures you need!Sord is the perfect way to jump-start the adoption of types in your project, whether you plan to use Sorbet's RBI format or Ruby 3/Steep's RBS format.Sord has the following features:Automatically generates signatures for modules, classes and methodsSupport for multiple parameter or return types (T.any/|)Gracefully handles missing YARD types (T.untyped/untyped)Can infer setter parameter type from the corresponding getter's return typeRecognises mixins (include and extend)Support for generic types such as Array and HashCan infer namespaced classes ([Bar] can become GemName::Foo::Bar)Handles return types which can be nil (T.nilable/untyped)Handles duck types (T.untyped/untyped)Support for ordered list types ([Array(Integer, Symbol)] becomes [Integer, Symbol])Support for boolean types ([true, false] becomes T::Boolean/bool)Support for .
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle