Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jennybc opened this issue Aug 11, 2022 · 0 comments · Fixed by #2461
Closed

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

jennybc opened this issue Aug 11, 2022 · 0 comments · Fixed by #2461
Labels
feature a feature request or enhancement

Comments

@jennybc
Copy link
Member

jennybc commented Aug 11, 2022

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.

@jennybc jennybc added the feature a feature request or enhancement label Aug 11, 2022
jennybc added a commit that referenced this issue Aug 11, 2022
jennybc added a commit that referenced this issue Aug 11, 2022
* Surface unused imports with `check(cran = TRUE)`

Closes #2459

* Add NEWS bullet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
1 participant