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
I want to use undesirable_function_operator to block install.packages on some files (where package installation should be handled by a build tool rather than in the script itself), however, it is common for Rmd scripts to include instructions on setting up the environment to reproduce the output that includes install.packages in an eval=FALSE cell.
I would like to skip linting in such cases -- what's the best way to go about this? An option to skip eval=FALSE Rmd cells in lintr::lint and lintr::get_soure_expressions?
Similarly, if I add a CSS-class to the quoted-code block, but don't add an evaluation engine (ie, I'll style this myself, since autoformatting isn't working, and eval=FALSE won't bypass the code), the file is Malformed:
Activity
AshesITR commentedon Nov 23, 2020
What would we do about
knitr::opts_chunk$set(eval = FALSE)?I think your usecase might better be served by replacing the eval = FALSE chunks by regular souce code chunks with r syntax highlighting using
```r.MichaelChirico commentedon Dec 15, 2020
@AshesITR I think you're right we won't be able to get a complete static solution. But checking explicit chunk options would still be an improvement.
russHyde commentedon May 17, 2021
Ran into a similar problem while writing a blogpost that mingles R<4.1 code/env with R-4.1 code:
"Error: unexpected '>'"
Note that when rewriting this to use 'quoted'-code block syntax, the lintr fails with a Malformed file error (which is a much bigger problem IMO)
Similarly, if I add a CSS-class to the quoted-code block, but don't add an evaluation engine (ie, I'll style this myself, since autoformatting isn't working, and eval=FALSE won't bypass the code), the file is Malformed:
"Error: Malformed file!"
AshesITR commentedon Jun 19, 2022
The "malformed file" error should be fixed now, so closing this as using
Should be the (preferable) way to achieve syntax highlighting without evaluation.
MichaelChirico commentedon Jun 19, 2022
I'm not sure this is fully solved ... but please open a new issue if there's still need for improvement here