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

formatR is required for a default tufte document #90

Closed
cderv opened this issue Nov 23, 2020 · 3 comments
Closed

formatR is required for a default tufte document #90

cderv opened this issue Nov 23, 2020 · 3 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Nov 23, 2020

We have tidy = TRUE as option in

knitr_options$opts_chunk$tidy = TRUE

This requires the formatR package which is not in import.

This is not a issue we've seen often because skeleton sets it to FALSE

knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tufte'))

I encountered this as a warning in rmarkdown tests
https://github.com/rstudio/rmarkdown/pull/1958/checks?check_run_id=1442968802#step:14:34
and it took me time to understand it came from here.

@yihui it is safe to add formatR to import, but a cleaner solution would be to set by default tidy option to FALSE. But it has been like that since the start (ea56b52 and 01a4f0a)

Why set to TRUE if FALSE in skeleton ?

Which solution do you prefer ?

@cderv
Copy link
Collaborator Author

cderv commented Nov 23, 2020

In fact even with the default template, if formatR is not installed, we get the warning

Warning messages:
1: In block_exec(params) : Failed to tidy R code in chunk 'setup'. Reason:
Error in loadNamespace(name) : there is no package called 'formatR'

That is unfortunate. It will be fixed with one of the two solution above.

@yihui
Copy link
Member

yihui commented Nov 24, 2020

I'm okay with removing the setting, which means using the default tidy = FALSE. Feel free to commit to the master branch with a news item. Thanks!

@cderv cderv closed this as completed in 3551518 Nov 25, 2020
@github-actions
Copy link

github-actions bot commented Jun 4, 2021

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants