Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tapioca/gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def ==(other)

#: (String gemfile_dir) -> bool
def ignore?(gemfile_dir)
gem_ignored? || gem_in_app_dir?(gemfile_dir, full_gem_path)
Copy link
Member

@paracycle paracycle Jan 16, 2026

Choose a reason for hiding this comment

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

I am afraid this won't be enough since the condition exists for a specific reason: In our core monolith at Shopify we have what we call "in-repo gems" which are gems that exist inside folders under the app path. Since they are under the app path, they already get type-checked by Sorbet, so we should not be generating extra RBI files for them as well. For all practical purposes, the code in those paths in our Core monolith is a part of the monolith even though it gets loaded as a gem.

Your case is similar but somewhat different. You load some actual gems from the vendor folder inside your app path, so you want to generate RBIs for them, but removing this condition will break our use-case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see. I tried adding typechecking to these gems and was able to work through the issues. Thanks 👍

gem_ignored?
end

#: -> String
Expand Down
8 changes: 8 additions & 0 deletions spec/tapioca/gemfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ def foo(a = T.unsafe(nil), b = T.unsafe(nil)); end
RbConfig::CONFIG["rubylibprefix"] = original_rubylibprefix
end

it "ignore? returns false for vendored gems in the app directory" do
# Create a vendored gem within the project directory
foo_gem = mock_gem("foo", "0.0.1", path: "#{@project.absolute_path}/vendor/gems")
foo_spec = make_spec(foo_gem)

refute(foo_spec.ignore?(@project.absolute_path))
end

private

#: (MockGem gem) -> Gemfile::GemSpec
Expand Down