Skip to content

Add sorbet for type checking#1873

Draft
Throne3d wants to merge 6 commits intomainfrom
add/sorbet
Draft

Add sorbet for type checking#1873
Throne3d wants to merge 6 commits intomainfrom
add/sorbet

Conversation

@Throne3d
Copy link
Copy Markdown
Contributor

@Throne3d Throne3d commented Nov 21, 2023

No idea if we'll ever merge this, just wanted to test out how it'd look + what it'd be like!

Update via:

  • bundle exec tapioca init
  • If we get new entries in sorbet/rbi/todo.rb, try adding entries to sorbet/tapioca/require.rb for those items, or if necessary create an entry in shims/gems.
  • bundle exec tapioca gem --all (previously bundle exec tapioca generate, even more previously gems)
  • bundle exec tapioca dsl
  • bundle exec srb tc - check type checking

Shopify/tapioca#1266

Comment thread sorbet/tapioca/compilers/will_paginate.rb
@Throne3d
Copy link
Copy Markdown
Contributor Author

There's a truly insane amount of vendored code here - TODO: gitignore sorbet/rbi (against the upstream recommendation) and just tell people to generate these files locally?

Comment thread app/controllers/application_controller.rb Outdated
@Throne3d
Copy link
Copy Markdown
Contributor Author

The todo command is deprecated and will be removed in a future release.

If your project is still missing type definitions for constants, try the following:

  1. Regenerate gem RBIs by running bin/tapioca gem --all and bin/tapioca annotations
  2. Generate RBIs for DSLs by running bin/tapioca dsl
  3. If the missing constants are defined in files that a gem does not load by default,
    manually require those files in sorbet/tapioca/require.rb and regenerate gem RBIs
  4. Manually create an RBI shim defining the missing constants

@Throne3d Throne3d force-pushed the add/sorbet branch 5 times, most recently from ffc863b to 7761302 Compare December 29, 2025 02:16
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

Successfully merging this pull request may close these issues.

1 participant