Skip to content

Commit b0bb8b5

Browse files
authored
Merge pull request #2310 from Shopify/ko/yard-doc-rbs
Skip RBS comments in YardDoc listener
2 parents 69ec4aa + bd0a552 commit b0bb8b5

11 files changed

Lines changed: 32 additions & 5960 deletions

File tree

lib/tapioca/gem/listeners/yard_doc.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def initialize(pipeline)
3030

3131
private
3232

33+
#: (String line) -> bool
34+
def rbs_comment?(line)
35+
line.strip.start_with?(": ", "| ")
36+
end
37+
3338
# @override
3439
#: (ConstNodeAdded event) -> void
3540
def on_const(event)
@@ -61,7 +66,7 @@ def documentation_comments(name, sigs: [])
6166
return [] if /(copyright|license)/i.match?(docstring)
6267

6368
comments = docstring.lines
64-
.reject { |line| IGNORED_COMMENTS.any? { |comment| line.include?(comment) } }
69+
.reject { |line| IGNORED_COMMENTS.any? { |comment| line.include?(comment) } || rbs_comment?(line) }
6570
.map! { |line| RBI::Comment.new(line) }
6671

6772
tags = yard_docs.tags

sorbet/rbi/gems/activesupport@7.1.5.1.rbi

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sorbet/rbi/gems/ostruct@0.6.0.rbi

Lines changed: 5 additions & 137 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sorbet/rbi/gems/racc@1.8.1.rbi

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sorbet/rbi/gems/rake@13.2.1.rbi

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)