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

Investigate adding type checks to the project #80

Closed
chrisalley opened this issue May 16, 2023 · 3 comments
Closed

Investigate adding type checks to the project #80

chrisalley opened this issue May 16, 2023 · 3 comments

Comments

@chrisalley
Copy link
Collaborator

chrisalley commented May 16, 2023

Despite some views to the contrary, types can add extra safety and stability to a project, at the expense of some extra typing/more verbose code.

Since Ruby is a dynamically typed language, if Pundit Matchers was to add type signatures to the project, this would need to be added as a seperate dependency. Some options include:


RBS

https://github.com/ruby/rbs

The official way of writing type signatures, a seperate gem but part of the Ruby project. Signatures are written in a seperate file and can be tested.

Sorbet

https://sorbet.org

Another type checker from Stripe that predates RBS. Type signatures are written in the same file, above the method definition.


Whatever option is chosen would go through GitHub Actions.

@tagliala
Copy link
Collaborator

tagliala commented Jul 28, 2024

Recently RBS has been added to money via RubyMoney/money#1054, but I really don't like all the duplication (included duplicated docs) there 😞

some extra typing/more verbose code

Unless that code is being generated somehow, it is not more verbose code, it is almost 2X docs and method/class definitions

@chrisalley
Copy link
Collaborator Author

I'm not planning to add type signatures myself, so I'm happy to close this issue if there's no interest.

@tagliala
Copy link
Collaborator

tagliala commented Aug 5, 2024

I would also close here, since this is also a non-production library

@chrisalley chrisalley closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
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