Conversation
6508059 to
df740be
Compare
|
Nice! |
|
rdoc doesn't seem to really handle this which I find kind of sad since I just cleaned it all up. The type annotations are put into method docs and the magic comment appears like 20 times on the main page |
|
@Earlopain ahh you're right, that's pretty ugly. I'll see if I can modify RDoc in some way before merging this. |
|
Turns out there's a special syntax in RDoc where you can use |
|
I didn't know about that syntax, TIL. Unfortunatly rdoc doesn't ignore the rbs_inline comments, so I applied the same thing to them. I think rdoc should just do this by itself (github.com/ruby/rdoc/issues/1614) but for now it doesn't. Without, it looks like this ( |
|
BTW, can we generate rbi signatures with this instead of handwriting them? There's https://github.com/Shopify/spoom?tab=readme-ov-file#translate-sigs-between-rbi-and-rbs, maybe we don't need to have them in two places |
| gem "steep", ">= 1.7.0.dev.1" | ||
| gem "tapioca" | ||
| gem "test-unit" | ||
| gem "tsort" # until rbs is bumped |
There was a problem hiding this comment.
I don't know what's up with dependabot but you can just manually bump rbs and this is not necessary anymore.
| desc "Generate RBS with rbs-inline" | ||
| task rbs_inline: :templates do | ||
| with_gemfile do | ||
| sh "bundle", "exec", "rbs-inline", "lib", "--output", "lib" |
There was a problem hiding this comment.
Should this be checked in CI or be part of the release process?

Generate RBS through inline annotations instead of through maintaining separate RBS files.
I have wanted this for a while, but frankly it has been daunting to try to convert the whole codebase, and previously Steep would just hang. It looks like it has gotten better to the point where this is now possible. The
typecheck:steepcodebase will now first extract out inline type annotations and put them into the sig directory. You can effectively ignore all files in that directory for the purposes of review.At present, this means basically the entire codebase is typechecked with steep, except the translation directory which depends on type signatures for parser/ripper/ruby_parser which do not exist.