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 more Sorbet typing to the gem #178

Open
hummusonrails opened this issue Oct 8, 2020 · 3 comments
Open

Add more Sorbet typing to the gem #178

hummusonrails opened this issue Oct 8, 2020 · 3 comments

Comments

@hummusonrails
Copy link
Contributor

The Vonage Ruby SDK has begun incorporating Sorbet to statically type the code, and you can contribute to it during Hacktoberfest!

We are looking for pull requests that continue the incremental adoption of Sorbet in the codebase in a thoughtful and meaningful way. How do you balance methods that take in a variety of optional parameters? How do you manage Sorbet adoption in this existing code the way it is currently structured -- adoption without doing major "code surgery" to the overall codebase.

@AnshMishra2001
Copy link

Hey! I am knew to open source development. Can I work on this issue under your able guidance?

@hummusonrails
Copy link
Contributor Author

Hey @AnshMishra2001, welcome to open source! Please feel free to study up on Sorbet on its official website, review the existing typing in the SDK and open up a small pull request with your first attempt and we can go from there!

@dduugg
Copy link

dduugg commented Jul 10, 2021

Hi, I've noticed the type declarations are breaking the yard task, by discarding the annotations and emitting a bunch of warnings like:

[warn]: in YARD::Handlers::Ruby::DSLHandler: Undocumentable method, missing name
	in file 'lib/vonage/sms.rb':95:

	95: sig { params(params: T::Hash[Symbol, T.untyped]).returns(Vonage::Response) }

[warn]: in YARD::Handlers::Ruby::DSLHandler: Undocumentable method, missing name
	in file 'lib/vonage/alerts.rb':15:

	15: sig { returns(Vonage::Response) }

[warn]: in YARD::Handlers::Ruby::DSLHandler: Undocumentable method, missing name
	in file 'lib/vonage/alerts.rb':31:

	31: sig { params(params: T::Hash[Symbol, T.untyped]).returns(Vonage::Response) }

These can be fixed by incorporating the yard-sorbet plugin (of which I am the maintainer). Would you be amenable to a PR that incorporates it? (It can also incorporate the type signatures into the documentation, raising the documentation coverage stat from 49% to 69%.)

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

No branches or pull requests

3 participants