Skip to content

Conversation

@mickeytgl
Copy link
Contributor

@mickeytgl mickeytgl commented Sep 1, 2025

Now that Sorbet supports RBS aliases, this PR updates the Gemfile and modifies the files under /lib to fix any type errors raised by Sorbet

Resolves #114

@marcoroth
Copy link
Owner

marcoroth commented Sep 1, 2025

Oh exciting! I missed that Sorbet added support for RBS type aliases!

@mickeytgl mickeytgl force-pushed the run-sorbet-in-ci branch 2 times, most recently from 4893e3d to 485aaca Compare September 7, 2025 14:31
@mickeytgl mickeytgl marked this pull request as ready for review September 22, 2025 14:14
output += " └── "
<%- end -%>
output += <%= field.name %>.tree_inspect(indent).gsub(/^/, " " * (indent + 1)).lstrip.gsub(/^/, "<%= prefix %>").delete_prefix("<%= prefix %>")
output += <%= field.name %>&.tree_inspect(indent)&.gsub(/^/, " " * (indent + 1))&.lstrip&.gsub(/^/, "<%= prefix %>")&.delete_prefix("<%= prefix %>") || ""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of annoying, but despite checking for field_name above, Sorbet still considers it could be nil, so we need to add safe navigators on every method. It does seem to work on sig files though. It might be one of the quirks of using Sorbet with rbs

Image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it might be worth to report this on Sorbet

@mickeytgl mickeytgl changed the title Update Sorbet and start fixing sorbet errors Add Sorbet check Sep 22, 2025
@mickeytgl
Copy link
Contributor Author

Bumping this @marcoroth ⬆️ let me know if this approach makes sense or if there's something I can change

@marcoroth
Copy link
Owner

Hey @mickeytgl, is this one ready to go from your side?

@mickeytgl
Copy link
Contributor Author

Yes, all good. sorbet should now be green. I explicitely didn't add tying on some files (like engine.rb) but I think it can be iterated on once there's a minimum working version

Copy link
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mickeytgl, thanks for working on this! I just got around to review this!

This looks good so far, but I noticed that the *.rbs files are not up-to-date. If you run bundle exec rake rbs_inline it will regenerate the *.rbs files in sig/.

But doing so leads to both failing srb tc and steep check for me locally. Would you mind taking a look? Thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run Sorbet in CI

2 participants