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.
Result of our discussions of https://github.com/hadley/r-pkgs/issues/828
We think this NOTE should surface with
check(cran = TRUE)
: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 totrue
(unused imports are ignored), which seems a bit perverse. In that case, it would be fiddly for us to makecheck(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.