-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Include an auto-generated RBI file when publishing the gem #1854
Comments
Hey, folks. In an effort to lighten our load as maintainers and be able to serve you better in the future, the faker-ruby team is working on cleaning out the cobwebs in this repo by pruning the backlog. As there are few of us, there are a lot of items that will simply never earn our attention in a reasonable time frame, and rather than giving you an empty promise, we think it makes more sense to focus on more recent issues. That means, unfortunately, that we must close this issue. Don't take this the wrong way: our aim is not to diminish the effort people have made or dismiss problems that have been raised. If you feel that we should reopen this issue, then please let us know so that we can reprioritize it. Thanks! |
Is your feature request related to a problem? Please describe.
I'd like to have a Sorbet RBI file included in Faker by default.
RBI files are type definition files, similar to
.d.ts
files in TypeScript.They look like this:
And if you use Sorbet in your project and have the VS Code extension, you can get these types and docs in your editor like so:
We can use Sord to generate them automatically from the YARD docs we've been creating.
As a proof of concept, I created this gist with instructions for creating a full RBI using Sord (it requires using Sord master + two of my PRs to it, which should be merged soon, as well as Faker w/ #1853 merged in). These instructions could be made into a Rake task so they'd be an automated part of the release process.
The file would be kept at
rbis/faker.rbi
and wouldn't effect anyone that wasn't using Sorbet. It'd effectively be invisible to most end-users.If you're adding new objects, please describe how you would use them
I'd use them to get typechecking in, validate that the YARD docs are correct (e.g. if one of our methods says it returns a String but I'm using it in my project like an Integer, then Sorbet will catch that and the typecheck will fail. This'd either mean that the YARD doc is wrong or I'm doing something dumb).
Describe alternatives you've considered
The main alternatives are:
sorbet-typed
to distribute the, this requires us to update the sorbet-typed definitions every time the gem receives an update.I'd be fine with
sorbet-typed
as a solution if we don't want to maintain it in this repo, but I'd like to use Faker as a test to see if this is a viable thing others could do :)Additional context
The text was updated successfully, but these errors were encountered: