Skip to content

Commit

Permalink
Disable CRAN incoming checks by default
Browse files Browse the repository at this point in the history
and add an incoming argument to check.

The CRAN incoming checks commonly generates NOTEs which may be confusing
to newer package authors, notably

     Version contains large components (0.0.0.9000)

     Unknown, possibly mis-spelled, fields in DESCRIPTION:
       'Remotes'

Therefore we disable these checks by default.
  • Loading branch information
jimhester committed Aug 2, 2018
1 parent 1990906 commit dbac1fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# devtools 1.13.3.9000

* `check()` gains a `incoming` option to toggle the CRAN incoming checks.

* `build_vignette()` gains a `keep_md` option to allow keeping the intermediate markdown output (#1726)

* Bioconductor support now provided by the BiocManager CRAN package instead of
Expand Down
15 changes: 9 additions & 6 deletions R/check.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#' is set to \code{TRUE}. If no spell checker is installed, a warning is
#' issued.)
#'
#' \item env vars set by arguments \code{remote} and
#' \item env vars set by arguments \code{incoming}, \code{remote} and
#' \code{force_suggests}
#' }
#'
Expand All @@ -59,6 +59,7 @@ check <- function(pkg = ".",
manual = FALSE,
cran = TRUE,
remote = FALSE,
incoming = remote,
force_suggests = FALSE,
run_dont_test = FALSE,
args = NULL,
Expand Down Expand Up @@ -118,6 +119,7 @@ check <- function(pkg = ".",
built_path,
cran = cran,
remote = remote,
incoming = incoming,
force_suggests = force_suggests,
run_dont_test = run_dont_test,
manual = manual,
Expand All @@ -137,6 +139,8 @@ check <- function(pkg = ".",
#' @param remote Sets \code{_R_CHECK_CRAN_INCOMING_REMOTE_} env var.
#' If \code{TRUE}, performs a number of CRAN incoming checks that require
#' remote access.
#' @param incoming Sets \code{_R_CHECK_CRAN_INCOMING_} env var.
#' If \code{TRUE}, performs a number of CRAN incoming checks.
#' @param force_suggests Sets \code{_R_CHECK_FORCE_SUGGESTS_}. If
#' \code{FALSE} (the default), check will proceed even if all suggested
#' packages aren't found.
Expand All @@ -150,7 +154,7 @@ check <- function(pkg = ".",
#' @param quiet if \code{TRUE} suppresses output from this function.
#' @inheritParams rcmdcheck::rcmdcheck
check_built <- function(path = NULL, cran = TRUE,
remote = FALSE, force_suggests = FALSE,
remote = FALSE, incoming = remote, force_suggests = FALSE,
run_dont_test = FALSE, manual = FALSE, args = NULL,
env_vars = NULL, check_dir = tempdir(), quiet = FALSE,
error_on = c("never", "error", "warning", "note")) {
Expand Down Expand Up @@ -184,7 +188,7 @@ check_built <- function(path = NULL, cran = TRUE,
args <- c(args, "--no-manual")
}

env_vars <- check_env_vars(cran, remote, force_suggests, env_vars)
env_vars <- check_env_vars(cran, remote, incoming, force_suggests, env_vars)
if (!quiet) {
cat_rule(
left = "Checking",
Expand All @@ -200,17 +204,16 @@ check_built <- function(path = NULL, cran = TRUE,
})
}

check_env_vars <- function(cran = FALSE, remote = FALSE,
check_env_vars <- function(cran = FALSE, remote = FALSE, incoming = remote,
force_suggests = TRUE, env_vars = character()) {
c(
aspell_env_var(),
# Switch off expensive check for package version
# https://github.com/r-lib/devtools/issues/1271
if (getRversion() >= "3.4.0" && as.numeric(R.version[["svn rev"]]) >= 70944) {
c("_R_CHECK_CRAN_INCOMING_REMOTE_" = as.character(remote))
} else {
c("_R_CHECK_CRAN_INCOMING_" = as.character(remote))
},
"_R_CHECK_CRAN_INCOMING_" = as.character(incoming),
"_R_CHECK_FORCE_SUGGESTS_" = as.character(force_suggests),
env_vars
)
Expand Down
15 changes: 9 additions & 6 deletions man/check.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbac1fa

Please sign in to comment.