Skip to content
Merged
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
1 change: 1 addition & 0 deletions lib/tapioca/gem/listeners/yard_doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class YardDoc < Base
"warn_indent:",
"shareable_constant_value:",
"rubocop:",
"@requires_ancestor:",
] #: Array[String]

IGNORED_SIG_TAGS = ["param", "return"] #: Array[String]
Expand Down
17 changes: 17 additions & 0 deletions spec/tapioca/gem/pipeline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4652,6 +4652,23 @@ def foo; end
assert_equal(output, compile)
end

it "does not compile RBS comments as yard documentation" do
add_ruby_file("foo.rb", <<~RUBY)
# typed: true

# @requires_ancestor: Kernel
class Foo; end
RUBY

output = template(<<~RBI)
class Foo
requires_ancestor { Kernel }
end
RBI

assert_equal(output, compile(include_doc: true))
end

it "ignores RBS signatures that contain errors" do
add_ruby_file("foo.rb", <<~RUBY)
# typed: true
Expand Down
Loading