Skip to content

[Feature Request] YARD support as method interface #383

@euglena1215

Description

@euglena1215

Suggestion

Support YARD as well as Sorbet as a method interface.

Details

I expect the following behavior.

# packs/foo/app/models/foo.rb
class Foo
  # @return [Bar]
  def bar
    self.bar
  end
end
# packs/bar/app/models/bar.rb
class Bar
end

As shown above, if a comment is placed in the bar method that can be interpreted as YARD to the Foo class, then the Foo class is handled as dependent on the Bar class.

Motivation

In our Rails application we use packwerk and use YARD to define types instead of sorbet.
(To be more precise, we use the sord gem to generate RBS from YARD to utilize type information in our editor and IDE).

I understand that you are recommending the use of Sorbet. However, if you support YARD, we can use packwerk more effectively.
I also expect that there are many Rails applications out there that do not use Sorbet, but use YARD. I think YARD support will lower the barrier to using packwerk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions