Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RBS type signature #38

Open
sferik opened this issue May 9, 2024 · 3 comments
Open

Add RBS type signature #38

sferik opened this issue May 9, 2024 · 3 comments

Comments

@sferik
Copy link

sferik commented May 9, 2024

First, thank you for creating this project! Shale is a very nicely designed library and I've enjoyed working with it.

My only feature request is for you to add an RBS type signature file (sig/shale.rbs) to this project. I type check my code with Steep and now that many of my classes inherit from Steep::Mapper, my type checker is throwing dozens of errors.

If you'd like to see an example, here is an .rbs file and Steepfile from one of my projects.

You may also find typeprof useful to generate RBS scaffolding.

@kgiszczak
Copy link
Owner

Would you be willing to take a stab at it? I'd gladly accept PR with this change. If not I'll try to add it myself, although it may take some time.

@sferik
Copy link
Author

sferik commented May 17, 2024

I forked this repo and created an rbs branch with two commits:

  1. Add Steep to typecheck
  2. Automatically generate RBS file using TypeProf

When I run bundle exec rake steep, it detects 245 problems in the auto-generated type signatures. I'm not sure I have the expertise in this library necessary to fix them, but I figured I would update this issue with the scaffolding I generated in case that inspires someone else to attempt to resolve these problems.

I believe the majority of these issues can be resolved by adding nil checks or specifying that the value will not be nil in the type signature.

@kgiszczak
Copy link
Owner

Thank you, that's a good start. I'll try to look into it and maybe add those type signatures when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants