-
Notifications
You must be signed in to change notification settings - Fork 121
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 a basic gem.rbi to lib/ruby. #92
Conversation
I'm stumped as to how the last one is supposed to be fixed.
Also, this exists already: https://github.com/sorbet/sorbet/blob/719eb639e535860a3f1e3288fed3dcd47586eb5e/rbi/stdlib/gem.rbi So that's probably a problem |
Any ideas on fixing this last error? 🤔
|
@connorshea I would propose removing the autogenerated sigs that have untyped. Putting them there locks in the sigs for everyone else, whereas by omitting them, people can one-off sig individual methods to have better types in the mean time while they're submitting a patch to add proper types upstream. It'll also make the file smaller, so fewer lines in the |
Removed all the untyped stuff 👍 |
It looks like the error with the bundler rbi is due to the bundler.rbi that exists in sorbet https://github.com/sorbet/sorbet/blob/master/rbi/gems/bundler.rbi |
Hmm, why do you think so? |
The build failure for your most recent commit says that you need to declare |
Any ideas on how to fix it? |
lib/ruby/all/gem.rbi
Outdated
AlmostNoSecurity = T.let(nil, T.untyped) | ||
DIGEST_NAME = T.let(nil, T.untyped) | ||
EXTENSIONS = T.let(nil, T.untyped) | ||
H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to extend Enumerable
here? That's likely what's causing problems with the bundler rbi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow, good catch. I'm not entirely sure how that got in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also be able to remove the changes to the bundler rbi now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The goal here is to resolve sorbet/sorbet#1455
There are a few problems with this as it is now:
_
parametersgem.rbi
should be part of theruby/
directory or not?gem.rbi
should actually berubygems.rbi
?Adding this RBI to my
sorbet/
directory and then regeneratinghidden.rbi
drops it down from 7419 lines to 3386 lines.