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

@param \dots are not recognized by @inheritParams #504

Closed
HenrikBengtsson opened this issue Sep 10, 2016 · 4 comments
Closed

@param \dots are not recognized by @inheritParams #504

HenrikBengtsson opened this issue Sep 10, 2016 · 4 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@HenrikBengtsson
Copy link
Contributor

For roxygen2 5.0.1, when using

@inheritParams from
@param \dots bla bla bla.

and the from file already contains another

@param \dots yada yada yada.

then @inheritParams fails to drop duplicate \dots resulting in an R CMD check warning:

* checking Rd \usage sections ... WARNING
Duplicated \argument entries in documentation object 'foo':
  ‘...’

This is not the case if one uses @param ... instead of @param \dots. It looks like @inheritParams is not aware of the \dots alternative to ....

@hadley
Copy link
Member

hadley commented Sep 20, 2016

Could you please provide a minimal reprex? It certainly looks like the code is trying to handle this situation (param_names[param_names == "\\dots"] <- "...")

@hadley hadley added the bug an unexpected problem or unintended behavior label Sep 20, 2016
HenrikBengtsson added a commit to HenrikBengtsson/upkg that referenced this issue Sep 20, 2016
@HenrikBengtsson
Copy link
Contributor Author

See https://github.com/HenrikBengtsson/upkg. It gives:

> devtools::check()
Updating upkg documentation
Loading upkg
Setting env vars ---------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building upkg ------------------------------------------------------------------
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD build '/home/hb/repositories/upkg' --no-resave-data --no-manual 

* checking for file/home/hb/repositories/upkg/DESCRIPTION... OK
* preparingupkg:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* buildingupkg_1.0.tar.gzSetting env vars ---------------------------------------------------------------
_R_CHECK_CRAN_INCOMING_USE_ASPELL_: TRUE
_R_CHECK_CRAN_INCOMING_           : FALSE
_R_CHECK_FORCE_SUGGESTS_          : FALSE
Checking upkg ------------------------------------------------------------------
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD check '/tmp/RtmpjayEmT/upkg_1.0.tar.gz' --as-cran --timings --no-manual 

* using log directory/tmp/RtmpjayEmT/upkg.Rcheck* using R version 3.3.1 (2016-06-21)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using options--no-manual --as-cran* checking for fileupkg/DESCRIPTION... OK
* this is packageupkgversion1.0* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether packageupkgcan be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... WARNING
Duplicated \argument entries in documentation object 'bar':...Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapterWriting R documentation filesin theWriting R
Extensionsmanual.
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking examples ... NONE
* DONE

Status: 1 WARNING
See/tmp/RtmpjayEmT/upkg.Rcheck/00check.logfor details.


R CMD check results
0 errors | 1 warning  | 0 notes
checking Rd \usage sections ... WARNING
Duplicated \argument entries in documentation object 'bar':...Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapterWriting R documentation filesin theWriting R
Extensionsmanual.

@hadley
Copy link
Member

hadley commented Sep 20, 2016

A minimal reprex (e.g. ~10 line snippet of R code) would really make it faster for me to debug this.

@HenrikBengtsson
Copy link
Contributor Author

HenrikBengtsson commented Sep 20, 2016

dir.create("R")
cat(file="R/foo.R", "
#' Foo something
#'
#' @param x An object.
#' @param y Another object.
#' @param \\dots Not used.
#'
#' @export
foo <- function(x=1, y=2, ...) list(x=x, y=y)


#' Bar something
#'
#' @inheritParams foo
#' @param \\dots Additional arguments passed to foo().
#'
#' @export
bar <- function(x=1, ...) foo(x=x, ...)
")

cat(file="DESCRIPTION", 'Authors@R: c(person("John", "Doe", role="cre", email="john@doe.org"))')

roxygen2::roxygenize(".", roclets="rd")

Look at man/bar.Rd;

> cat(readLines("man/bar.Rd"), sep="\n")
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/foo.R
\name{bar}
\alias{bar}
\title{Bar something}
\usage{
bar(x = 1, ...)
}
\arguments{
\item{x}{An object.}

\item{...}{Not used.}

\item{\dots}{Additional arguments passed to foo().}
}
\description{
Bar something
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants