Skip to content
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

Inheriting documentation including dynamic dots in decorator functions #1670

Open
robchallen opened this issue Oct 15, 2024 · 0 comments
Open

Comments

@robchallen
Copy link

I've written a decorator for dplyr functions that does some additional work before handing off to dplyr. I want to inherit the documentation from dplyr, including any documentation of dynamic dots. It seems this is not possible as @inherit or @inheritParams alone will not import named dplyr parameters that are not present in my decorator, and @inheritDotParams will not import dplyr documentation of ... as a parameter. Minimal example as below:

#' Function to be inherited from
#'
#' I would like parameters `a`, `b` and `...` to be documented in decorator functions below.
#'
#' @param a param one in function one
#' @param b param two in function one
#' @param ... important documentation of name value parameters in function one.
#'
#' @return stuff
#' @export
#'
#' @examples
#' print("hi")
one = function (a, b, ...) {

}


#' Decorator function calling function one
#'
#' This does document `a` and `b` from function one, but unfortunately this does
#' not document parameter `...` from function one.
#'
#' @param x param one in function two.
#'
#' @inherit one
#' @inheritDotParams one
two = function(x, ...) {
  # do something with x
  one(...)
}


#' Another decorator function calling function one
#'
#' This does document `...` from function one, but unfortunately does not
#' document parameters `a` and `b`
#'
#' @param y param one in function three.
#' @inherit one
three = function(y, ...) {
  # do something with y
  one(...)
}

N.B. roxygen2 version 7.3.1
Is there any way to inherit everything? I can see there could be potential recursion issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant