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

For knitr, the chunk option message = FALSE will suppress messages now #25

Open
yihui opened this issue Dec 15, 2022 · 6 comments
Open

Comments

@yihui
Copy link

yihui commented Dec 15, 2022

This package is failing on CRAN right now: https://cran.r-project.org/web/checks/check_results_whereami.html The failed test is

testthat::expect_message(

This is because a change in the evaluate package: https://github.com/r-lib/evaluate/blob/main/NEWS.md#version-019 That means message = FALSE will completely suppress the messages.

Sorry for not discovering this earlier (because whereami is not a reverse dependency of evaluate)!

@yonicd
Copy link
Owner

yonicd commented Dec 15, 2022

No worries I saw a message from CRAN the other day. I will update and resubmit. thanks for reaching out to show what the fix is!

@yonicd
Copy link
Owner

yonicd commented Dec 16, 2022

@yihui I am not sure if I follow where {evaluate} fits in, I don't see a formal for message or keep_message in the {knitr} call

Am I not running the test correctly under the changes to {knitr}?

testthat::test_that("thisfile works with knitr", {
  testthat::skip_if_not_installed("knitr")
  out <- tempfile(pattern = "whereami", fileext = ".md")
  testthat::expect_message(
    knitr::knit("scripts/thisfile.Rmd", output = out, quiet = TRUE),
    normalizePath("scripts/thisfile.Rmd"),
    fixed = TRUE
  )
})

thanks

> packageVersion('knitr')
[1] ‘1.41’
> formals(knitr::knit)
$input


$output
NULL

$tangle
[1] FALSE

$text
NULL

$quiet
[1] FALSE

$envir
parent.frame()

$encoding
[1] "UTF-8"

@yihui yihui changed the title For knitr, message = FALSE will suppress messages now For knitr, the chunk option message = FALSE will suppress messages now Dec 16, 2022
@yihui
Copy link
Author

yihui commented Dec 16, 2022

I was unclear and just modified the issue title here. I meant the chunk option message:

```{r echo=FALSE, results='markup', comment="", message=FALSE}

@yonicd
Copy link
Owner

yonicd commented Dec 16, 2022

Ah. That makes sense. Thanks for the clarification!

@yihui
Copy link
Author

yihui commented Dec 23, 2022

Just FYI, I added support for the old behavior in evaluate and knitr---you can set message = NA after their next versions are released to CRAN.

@yonicd
Copy link
Owner

yonicd commented Dec 23, 2022

thanks for the update. I rewrote the test to work around the new functionality and pushed to cran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants