From 75c8c2321607274d7b4df48a824ef1f1a902e800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 21 May 2019 13:56:29 +0200 Subject: [PATCH] Forwarding arguments to rhub::check() from check_rhub() --- NEWS.md | 3 +++ R/r-hub.R | 10 +++++++--- man/check_rhub.Rd | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 697982ac3..2989f95ca 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # devtools (development version) +* `check_rhub` gains a new argument `build_args` for arguments passed to +`R CMD build`. `...` is now passed to `rhub::check_for_cran()` + * `test_file()` and `test_coverage_file()` now work with C and C++ files in the src/ directory as well. diff --git a/R/r-hub.R b/R/r-hub.R index 9da30c3b8..a55103d9e 100644 --- a/R/r-hub.R +++ b/R/r-hub.R @@ -22,7 +22,8 @@ #' @param interactive whether to show the status of the build #' interactively. R-hub will send an email to the package maintainer's #' email address, regardless of whether the check is interactive or not. -#' @param ... extra arguments, passed to [pkgbuild::build()]. +#' @param build_args Arguments passed to `R CMD build` +#' @param ... extra arguments, passed to [rhub::check_for_cran()]. #' @inheritParams check #' @family build functions, rhub functions #' @return a `rhub_check` object. @@ -33,18 +34,21 @@ check_rhub <- function(pkg = ".", platforms = NULL, email = NULL, interactive = TRUE, + build_args = NULL, ...) { check_suggested("rhub") pkg <- as.package(pkg) - built_path <- build(pkg$path, tempdir(), quiet = !interactive, ...) + built_path <- build(pkg$path, tempdir(), quiet = !interactive, + args = build_args) on.exit(unlink(built_path), add = TRUE) status <- rhub::check_for_cran( path = built_path, email = email, platforms = platforms, - show_status = interactive + show_status = interactive, + ... ) if (!interactive) { diff --git a/man/check_rhub.Rd b/man/check_rhub.Rd index 1346b5f40..a058568d8 100644 --- a/man/check_rhub.Rd +++ b/man/check_rhub.Rd @@ -5,7 +5,7 @@ \title{Run CRAN checks for package on R-hub} \usage{ check_rhub(pkg = ".", platforms = NULL, email = NULL, - interactive = TRUE, ...) + interactive = TRUE, build_args = NULL, ...) } \arguments{ \item{pkg}{package description, can be path or package name. See @@ -23,7 +23,9 @@ address in the package.} interactively. R-hub will send an email to the package maintainer's email address, regardless of whether the check is interactive or not.} -\item{...}{extra arguments, passed to \code{\link[pkgbuild:build]{pkgbuild::build()}}.} +\item{build_args}{Arguments passed to \code{R CMD build}} + +\item{...}{extra arguments, passed to \code{\link[rhub:check_for_cran]{rhub::check_for_cran()}}.} } \value{ a \code{rhub_check} object.