lsegal/yard

'Undocumentable mixin' when including a non-constant

Closed this issue · 2 comments

jch commented

I get the following warning:

[warn]: in YARD::Handlers::Ruby::MixinHandler: Undocumentable mixin: YARD::Parser::UndocumentableError for class FacebookImporter

when attempting to parse:

include Addressbook::Application.routes.url_helpers

This makes sense since yard can't infer the semantics of what #url_helpers should return, but would it be reasonable to return the unparsable mixin verbatim without linking it? In the meantime, is there a tag to force yard to ignore this line and suppress the warning?

It would not be reasonable to return the unparseable mixin verbatim. Doing so would generate an inconsistent model of your code, because YARD could no longer guarantee that all of the object.mixins are actual ModuleObjects (which YARD uses internally but also exposes to plugin developers and even to query filtering on the command line). It also can't properly associate this data or use it in any truly useful way, so there really isn't a benefit to doing this.

As for suppressing the warning, you can use -q to hide warnings.

jch commented

Thanks for the clarification and fix ;)