You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running R CMD check --no-build-vignettes on a package which has a vignette with a '''{r error=TRUE} block results in a check error because R script that was purl'ed from the vignette, does not account for the error=TRUE.
For example, if we check the V8 package with --no-build-vignettes I get:
R CMD check --no-build-vignettes V8_5.0.1.tar.gz
# ....# * checking package vignettes ... OK# * checking running R code from vignettes ...# ‘npm.Rmd’ using ‘UTF-8’... OK# ‘v8_intro.Rmd’ using ‘UTF-8’... failed# ERROR
Because CRAN now published the purled script on the site, we can easily see the problem:
Note that the Rmd contains several eval=FALSE and error=TRUE chunks. The eval=FALSE chunks are commented out in the output script, which makes sense. However the error=TRUE chunk is run as-is, and hence script errors.
I think the chunk that contains error=TRUE should be wrapped in try({....}) in the purled script. The default behavior of try is silent=FALSE so it results in the identical behavior as when building the vignette: display the error and proceed.
The text was updated successfully, but these errors were encountered:
jeroen
changed the title
Should purl() wrap error=true blocks in try()
Should purl() wrap error=true chunks in a try({}) block
Oct 8, 2024
jeroen
changed the title
Should purl() wrap error=true chunks in a try({}) block
Should purl() wrap try({}) blocks around error=true chunks ?
Oct 8, 2024
Running
R CMD check --no-build-vignettes
on a package which has a vignette with a'''{r error=TRUE}
block results in a check error because R script that was purl'ed from the vignette, does not account for theerror=TRUE
.For example, if we check the V8 package with
--no-build-vignettes
I get:Because CRAN now published the purled script on the site, we can easily see the problem:
<-- purled script by cran
Note that the Rmd contains several
eval=FALSE
anderror=TRUE
chunks. Theeval=FALSE
chunks are commented out in the output script, which makes sense. However theerror=TRUE
chunk is run as-is, and hence script errors.I think the chunk that contains
error=TRUE
should be wrapped intry({....})
in the purled script. The default behavior of try issilent=FALSE
so it results in the identical behavior as when building the vignette: display the error and proceed.The text was updated successfully, but these errors were encountered: