r-lib / styler

Non-invasive pretty printing of R code
https://styler.r-lib.org
Other
713 stars 70 forks source link

Error on files with reference chunks (`<<chunk>>`) in .Rnw/.Rmd #1140

Open MichaelChirico opened 1 year ago

MichaelChirico commented 1 year ago

{lintr} 3.1.0 simply skips these:

https://github.com/r-lib/lintr/issues/779

But I just ran into the error when trying to style a file:

Warning message:
When processing /path/to/file.rmd: ℹ In index: 3.
Caused by error in `parse_safely()`:
! <text>:1:1: unexpected input
1: <<
    ^ 

See the lintr issue & PR for some examples.