Questions tagged [steep]

Static type checker for Ruby https://github.com/soutaro/steep

Static type checker for Ruby https://github.com/soutaro/steep

5 questions
5
votes
1 answer

How to configure Steep to find RBS files for a gem outside the stdlib?

Cannot find type `Sinatra::Base` ruby file class StaticApp < Sinatra::Base end rbs file class StaticApp < Sinatra::Base end run bundle exec steep check --log-level=fatal result [error] Cannot find type `Sinatra::Base` Diagnostic ID:…
gayavat
  • 18,910
  • 11
  • 45
  • 55
1
vote
2 answers

Ruby RBS: Declaring schema for a hash

In the application my team and I are working on, we heavily utilize Ruby hashes as data transfer objects(DTOs). Also, currently, we would like to try the combination of RBS and Steep to see if it will bring any noticeable benefit to the development…
TK-95
  • 1,141
  • 2
  • 10
  • 21
1
vote
1 answer

Ruby types and singleton methods

I'm seeing some unexpected behaviour setting up RBS types on an existing Ruby project. A minimal example: # lib/a.rb class A def self.foo new end end class B < A def self.foo super end end puts A.foo.inspect puts…
jjg
  • 907
  • 8
  • 18
1
vote
1 answer

steep check returns RBS::UnknownTypeName on DateTime

I am implementing a .rbs file for the ruby code and everything works but the DateTime. This is what I have: ruby file: class foo # other attributes attr_reader :bar def initialize(bar) @bar = bar end end this is the rbs file: class…
TiGreX
  • 1,602
  • 3
  • 26
  • 41
1
vote
0 answers

Telling Steep that values are guaranteed to be non-nil

I wanted to start using Steep for one of my projects, but I keep getting errors that I don't know how to fix. This is one example extracted from my code that I am struggling with. I removed all the complexity except for the relevant bits: Setup #…
Lykos
  • 1,039
  • 6
  • 25