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
example_file<- tempfile()
readr::write_file(path=example_file,
x='# Rmd example file## R code chunkThe following is linted fine:```{r}print ("hi" )```## Plain code blockThe following fenced code block _without_ a language identifier is not linted (also fine!):```print ("hi" )```## Code block with language identifierThe language identifier of the following code block triggers a \'malformed file\' error (bad!):```rprint ("hi" )```')
lintr::lint(filename=example_file)
#> Error: Malformed file!
Created on 2020-07-03 by the reprex package (v0.3.0)
Markdown code blocks with a language identifier are valid R Markdown syntax and should simply be excluded from linting.
Possibly related
If I understand it correctly, R Markdown files should be supported by lintr as of 50ab86d fixing #32.
In #252, a similar issue was raised which has been solved by fdd1950, assumedly without properly handling language identifiers. I'm not familiar with lintr's internals and didn't dive into the code, but I guess the R code extraction logic in https://github.com/jimhester/lintr/blob/master/R/extract.R is erroneous. Maybe @russHyde or @jimhester could have a look at this?
Problem
Consider the following reprex:
Created on 2020-07-03 by the reprex package (v0.3.0)
Markdown code blocks with a language identifier are valid R Markdown syntax and should simply be excluded from linting.
Possibly related
If I understand it correctly, R Markdown files should be supported by lintr as of 50ab86d fixing #32.
In #252, a similar issue was raised which has been solved by fdd1950, assumedly without properly handling language identifiers. I'm not familiar with lintr's internals and didn't dive into the code, but I guess the R code extraction logic in https://github.com/jimhester/lintr/blob/master/R/extract.R is erroneous. Maybe @russHyde or @jimhester could have a look at this?
Maybe also related: #322
The text was updated successfully, but these errors were encountered: