Bioconductor / BiocCheck

http://bioconductor.org/packages/BiocCheck
8 stars 26 forks source link

Example errors for S4 generic definitions #109

Closed ChristopherEeles closed 4 years ago

ChristopherEeles commented 4 years ago

As currently implemented, this package expects exported S4 generics to have runnable examples, since these count towards the 80% of exported methods which require runnable examples.

For generics with no default method, however, this doesn't make sense. If you are just defining the generic, then it should not need an example. The same is true of the @return tag, since for some generics the return type will be dependent on the specific method implementation.

I was curious if this is intentional and if there is anyway around this other than adding dummy examples and return values? Maybe there is a tag I can add to generic documentation to specify that a function is a generic with no default method?

Thanks for your support.

Best, Chris

LiNk-NY commented 4 years ago

Hi Christopher, @ChristopherEeles

I usually do something like this in roxygen2 to document them. Meaning I combine the generic documentation with the methods and include examples. https://stackoverflow.com/questions/24246594/automatically-document-all-methods-of-an-s4-generic-using-roxygen2

Best, Marcel