Skip to content

Add "_R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_" = "false" to check(cran = TRUE) #2459

@jennybc

Description

@jennybc

Result of our discussions of hadley/r-pkgs#828

We think this NOTE should surface with check(cran = TRUE):

* checking dependencies in R code ... NOTE
Namespace in Imports field not imported from: ‘pkgA’
  All declared Imports should be used.

In R 4.1 and earlier, R CMD check --as-cran seems to actively result in _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_ being set to true (unused imports are ignored), which seems a bit perverse. In that case, it would be fiddly for us to make check(cran = TRUE) surface this NOTE.

However as of R 4.2, the env var seems to be settable in combination with --as-cran, so we should probably set it and just accept that the desired outcome will only happen as folks update R.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions