Description
When using @inheritDotParams with argument exclusions (e.g. -arg), if the exclusions span multiple lines, the very first exclusion on each subsequent line is silently ignored, and those arguments are erroneously included in the generated .Rd file.
This is especially problematic when styling roxygen documentation using the "Reflow Comment" feature in RStudio, which automatically wraps long lines and pushes exclusions onto new lines.
#' Test function
#' @param foo foo
#' @param bar bar
#' @param baz baz
#' @param qux qux
#' @param quux quux
foo <- function(foo, bar, baz, qux, quux) {}
#' Bar function
#' @inheritDotParams foo -foo
#' -bar -baz
#' @export
bar <- function(...) {}
The generated bar.Rd file incorrectly includes bar in the \arguments section, while successfully excluding foo and baz:
\arguments{
\item{...}{
Arguments passed on to \code{\link[=foo]{foo}}
\describe{
\item{\code{bar}}{bar}
\item{\code{qux}}{qux}
\item{\code{quux}}{quux}
}
}
}
Because -bar was silently dropped due to being attached to the newline, it successfully inherited bar instead of excluding it.
Description
When using
@inheritDotParamswith argument exclusions (e.g.-arg), if the exclusions span multiple lines, the very first exclusion on each subsequent line is silently ignored, and those arguments are erroneously included in the generated.Rdfile.This is especially problematic when styling roxygen documentation using the "Reflow Comment" feature in RStudio, which automatically wraps long lines and pushes exclusions onto new lines.
The generated
bar.Rdfile incorrectly includesbarin the\argumentssection, while successfully excludingfooandbaz:Because
-barwas silently dropped due to being attached to the newline, it successfully inheritedbarinstead of excluding it.