devtools icon indicating copy to clipboard operation
devtools copied to clipboard

`document(quiet = TRUE)` is too quiet when a required package is not installed

Open haugedal opened this issue 2 years ago • 1 comments

When running document() with the argument quiet = TRUE on a package where another required package is not installed you get the following “question”:

Selection:

With no information about what you are answering/selecting or how to answer/select.

The unsuppressed question with selections is as follows:

ℹ The package "packageName" is required.
✖ Would you like to install it?

1: Yes
2: No

It seems reasonable to show this information when running document(), even with quiet = TRUE.

haugedal avatar Aug 14 '23 12:08 haugedal

I agree it is reasonable to surface this, but this is also relatively low priority. I think an attempt to do any other package development task will likely also surface this problem in a less cryptic way.

I see this in roxygen2::roxygenize():

https://github.com/r-lib/roxygen2/blob/066c3a504ef94e9fcdf3a133706e59e184dfaa27/R/roxygenize.R#L53-L55

if (!is_interactive()) {
    withr::local_options(warn = 1)
}

So the easiest fix would be to call roxygen2::roxygenize() as if non-interactive when quiet = TRUE to get whatever the intended experience is in a non-interactive session.

jennybc avatar Nov 02 '23 19:11 jennybc