-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Should purl() wrap try({})
blocks around error=true
chunks ?
#2368
Comments
jeroen
changed the title
Should purl() wrap error=true blocks in
Should purl() wrap Oct 8, 2024
try()
error=true
chunks in a try({})
block
jeroen
changed the title
Should purl() wrap
Should purl() wrap Oct 8, 2024
error=true
chunks in a try({})
blocktry({})
blocks around error=true
chunks ?
Yes, I think that's a good idea. Will do. |
yihui
added a commit
that referenced
this issue
Nov 1, 2024
yihui
added a commit
that referenced
this issue
Nov 1, 2024
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: