Skip to content
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

How to skip constants with tapioca gem GEM? #2183

Open
ivy opened this issue Feb 4, 2025 · 1 comment
Open

How to skip constants with tapioca gem GEM? #2183

ivy opened this issue Feb 4, 2025 · 1 comment

Comments

@ivy
Copy link

ivy commented Feb 4, 2025

Hi! 👋 I ran into a problem where I wanted to run tapioca gem activesupport but I was getting errors from Sorbet because ActiveSupport::TestCase extends from Minitest which is not a dependency in my project. I didn't want to add it so I worked around it by making a hack with the following:

# sorbet/tapioca/require.rb
require 'active_support'
ActiveSupport.const_set(:TestCase, nil)

This feels icky and I'd have preferred to have something like:

# sorbet/tapioca/config.yml

gem:
  skip_constant:
    - "ActiveSupport::TestCase"

That doesn't appear to be an option though! Am I misunderstanding how tapioca dsl is intended to be used? Please me know if I missed something in the docs! Thanks a bunch! 😅

@KaanOzkan
Copy link
Contributor

Can you share the exact error you're seeing? Minitest is a dependency of ActiveSupport so there's another underlying issue. You should get both minitest and activesupport RBIs when you run bin/tapioca gem (note that it has no arguments, running tapioca gem activesupport is not enough).

And yes, skip_constant is a dsl option not gem. gem command doesn't need constant skipping unlike dsl

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

No branches or pull requests

2 participants