-
Notifications
You must be signed in to change notification settings - Fork 26
Prepare to introduce rbs and add a configuration file #238
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
Conversation
To add types, I would like to have help from typeprof to define rbs files for current library code that's why I added both steep and typeprof to gemspec.
This file indicates that type definition files are placed in the `sig` directory and the actual implementation files that I want to define types for are located in the `lib` directory. Additionally, it is configured to disable type error checking so as not to raise much errors.
Steepfile
Outdated
|
||
configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting |
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.
Why do we need this?
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.
I added this to prevent errors from RBS file inconsistencies from blocking other feature development.
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.
OK. Could you share the documentation for this configuration?
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.
I refer to this document.
https://github.com/soutaro/steep/blob/master/manual/ruby-diagnostics.md
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.
Based on it, how about using lenient
instead of silent
?
It seems that silent
reports nothing even for a RBS syntax error: https://github.com/soutaro/steep/blob/master/manual/ruby-diagnostics.md#rubyannotationsyntaxerror
Is it useful for us?
It seems that lenient
reports an error only for a RBS syntax error. It reports something or nothing for other cases.
It will be useful for us. For example, we may be able to check our RBS in CI.
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.
Thank you for your advice and I agree with that.
I updated with this commit e615a4b.
red-datasets.gemspec
Outdated
spec.add_development_dependency("steep") | ||
spec.add_development_dependency("typeprof") |
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.
Ah, could you use Gemfile
for development dependencies?
(We should move all add_development_dependency
s eventually but we should work on it as a separated PR.)
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.
I moved added gems to Gemfile with this commit. 022ada1
since want to write all of them in Gemfile in the future
Let's try this. |
What I did in this PR
To introduce rbs to this repository, I added the necessary gems like
steep
andtypeprof
to gemspec file.I use these two gems to get support for the RBS file's type checking and type generation.
I also added a Steepfile, which includes how to check the RBS files. The configuration of Steepfile is minimal, such as which directory to put RBS files in and not to raise an error with type checking at first.
What I didn't do in this PR
This is a PR for preparation to introduce RBS to this repository, I added only configuration files.
The actual RBS file will be added in the next PR with a new dataset.