Conversation
|
@hsbt I'm working on a commit to add type checking/verification with Steep now. |
47d857d to
06efd91
Compare
|
@sferik Which one would you like? |
|
@ksss I've added Steep as a development dependency along with a new I understand the concern about type coverage. The signatures in this PR were generated with |
32765fb to
1c2cf68
Compare
ksss
left a comment
There was a problem hiding this comment.
I agree with the argument that type definitions should be included in gems. In that case, the following should be considered:
- Please respect and inherit past assets. Please consider https://github.com/ruby/rbs/blob/master/stdlib/net-http/0/net-http.rbs.
- RBS documentation is missing. Comments need to be synchronized with Ruby files. Consider using the
rbs annotatecommand. You can refer to ruby/bigdecimal and others for examples. - Test code for type definitions is missing.
steep checkhas strong implications for the internal implementation ofnet/httpand does not test the public interface.net/httpis currently a default gem, and test code for type definitions that can be executed in theruby/rubyrepository is needed. Test code should be defined by referring to https://github.com/ruby/rbs/blob/master/test/stdlib/Net_HTTP_test.rb. Also, consider that these tests should not access external URLs. - Organize dependencies between libraries. Dependencies of default gems should be described using
manifest.yaml, as shown in https://github.com/ruby/rbs/blob/master/stdlib/net-http/0/manifest.yaml.
|
Thank you for this valuable feedback. I am working on fixes now. |
Add `steep` to Gemfile, add `steep` rake task, and add `typecheck` GitHub workflow.
328ba6a to
d114582
Compare
|
@ksss I then added I then ran Finally, I added local RBS interface tests. Do you think I should also keep Steep or remove it? Please let me know if I got anything wrong or missed anything. Thanks again for your feedback! |
d114582 to
5a7d2e1
Compare
|
I also added Please also let me know if you'd like me to squash these down into a single commit. |
Adjust library code to make dynamic behavior explicit for Steep with small, behavior-preserving changes: add local narrowing, nil guards, key coercions, read_body call shaping, and a few compatibility-focused internal fixes.
Update the public RBS to better match actual net/http behavior around URI handling, nilable headers and response bodies, exception classes, and request/response entry points. Keep shipped signatures in sig/ focused on net/http’s public API, and add a separate *-impl.rbs files for implementation-only declarations used only by Steep when typechecking lib/. The *-impl.rbs files cover internal protocol classes, helper methods, constants, and stdlib gaps needed by the implementation, without shipping those internal details as part of the gem’s public RBS.
174b9b2 to
8527e9c
Compare
8527e9c to
9b7151a
Compare
ksss
left a comment
There was a problem hiding this comment.
I have no maintenance privileges whatsoever for this repository. I don't even have the authority to approve this PR. I will state my personal opinion based on this premise.
I think simply copying net-http.rbs was an excellent decision. That's where you should start. However, you should start with as complete a copy as possible. I don't know what the differences are, so I can't review it.
I think we should first implement the introduction of RBS, and then as the next step, tackle changes to the Ruby code. These seem like separate issues. I think the PRs should be split.
Steep is a development support tool. If you want to use Steep for developing this repository, then I think it should be introduced, but otherwise, I think it should be left to the developers.
The idea of *-impl.rbs is great, but for the same reason as Steep, I don't think it should be included in this PR.
|
Closing this PR in favor of:
Feel free to review and merge each of these independently. I hope this helps move this issue forward. |
No description provided.