-
Notifications
You must be signed in to change notification settings - Fork 113
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
[Feature Request] YARD support as method interface #383
Comments
Just a note that there's no explicit support for sorbet in packwerk. It "just works" since sorbet signatures are just Ruby code and use constant references. It's a lucky coincidence. So there's no pre-existing method interface parsing mechanism that we can just add YARD to. I do agree though that YARD support would be useful. |
There are some efforts underway to allow for client configured parsers: #375 This would permit a plugin to parse classes declared in YARD comments. Besides that though I agree it'd make sense to permit YARD comments to be parsed this way (regardless if it's implemented in packwerk itself or as a community maintained plugin in packwerk-extensions)! |
Thank you for the information!
I look forward to waiting for that PR to be merged. I will try to create a packwerk-yard gem with https://github.com/richardmarbach/packwerk-haml as a reference. |
I am creating https://github.com/euglena1215/packwerk-yard. I found something in the original pull request that needs to be fixed in the process of making it, so I commented on it. #375 (comment) |
Thank you for the issue but we have no interest in parsing YARD in this tool. |
Suggestion
Support YARD as well as Sorbet as a method interface.
Details
I expect the following behavior.
As shown above, if a comment is placed in the
bar
method that can be interpreted as YARD to theFoo
class, then theFoo
class is handled as dependent on theBar
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.
The text was updated successfully, but these errors were encountered: