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

Handling of interactive No to clean_doc question #186

Open
RossBoylan opened this issue May 21, 2024 · 0 comments
Open

Handling of interactive No to clean_doc question #186

RossBoylan opened this issue May 21, 2024 · 0 comments
Labels
tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@RossBoylan
Copy link

The meaning of a No response to the interactive prompt is unclear, even after selecting it. Furthermore, the ensuing behavior is surprising and unhelpful.

Sample

This is from a vanilla R session (not RStudio):

> devtools::build()
Running bootstrap.R...
# ...
Building the package will delete...
  'C:/Users/rdboylan/Documents/BP/pimex/inst/doc'
Are you sure?

1: Yes
2: No

Selection: 2
-- R CMD  ---------------------------------------------------------------------------------------
no("wd") || is_string(wd) is not TRUE
eval(substitute(expr), data, enclos = parent.frame())
TRUE
NULL
NULL
30180
1716004002
0

Problems

  1. Are you sure? probably means "do you want to delete inst/doc?", but it could mean "do you want to continue with the build?" It's ambiguous. For the pedantic, there is a 3rd interpretation: "say whether or not you are sure that this tool deletes the directory".
  2. The material following Selection: 2 has no obvious meaning or significance. In particular, it doesn't resolve the question of whether the deletion or the whole build was aborted.
  3. It seems that selecting 2, aka No actually did abort the build, since no tarball resulted. It would be more helpful if it left the directory in place and continued with the build.

Desired Behavior

  • Selecting No leaves inst/doc and proceeds with the build.
  • Selecting No does not produce the meaningless output shown above.
  • The question clearly indicates what behavior will result from a Yes or No response, and that matches what happens.

"leaves inst/doc" above simply means the deletion of the directory is skipped; it is not intended to mean no new material such as vignettes will be placed in inst/doc.

Code

https://github.com/r-lib/pkgbuild/blob/90f017b337ae23006b10fd8a5db1040ddf5fd401/R/build.R#L251C1-L256C10 seems to be the relevant code. If option 2 is selected then return() is executed. My expectation, and I think the intention, is that it simply exits from the block beginning at

if (build_vignettes && (is.null(clean_doc) || isTRUE(clean_doc))) {
and proceeds. But the remaining steps are in body of the same function and the return simply skips them.

Context

R 4.4.0
pkgbuild 1.4.4
devtools 2.4.5
MS Windows amd64

@gaborcsardi gaborcsardi added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

2 participants