Skip to content

Commit

Permalink
Surface unused imports with check(cran = TRUE)
Browse files Browse the repository at this point in the history
Closes #2459
  • Loading branch information
jennybc committed Aug 11, 2022
1 parent 37bfbd1 commit 8f459bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ can_document <- function(pkg) {
#' @rdname check
#' @param path Path to built package.
#' @param cran if `TRUE` (the default), check using the same settings as CRAN
#' uses.
#' uses. Because this is a moving target and is not uniform across all of
#' CRAN's machine, this is on a "best effort" basis. It is more complicated
#' than simply setting `--as-cran`.
#' @param remote Sets `_R_CHECK_CRAN_INCOMING_REMOTE_` env var. If `TRUE`,
#' performs a number of CRAN incoming checks that require remote access.
#' @param incoming Sets `_R_CHECK_CRAN_INCOMING_` env var. If `TRUE`, performs a
Expand Down Expand Up @@ -188,6 +190,10 @@ check_built <- function(path = NULL, cran = TRUE,

if (cran) {
args <- c("--as-cran", args)
env_vars <- c(
"_R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_" = as.character(FALSE),
env_vars
)
}
if (run_dont_test) {
args <- c("--run-donttest", args)
Expand Down
4 changes: 3 additions & 1 deletion man/check.Rd

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

0 comments on commit 8f459bd

Please # to comment.