I found a bug with annotate_fun_calls, if the R code has wrong syntax (unparsable code), then the annotated adds "# No used functions found" instead of avoiding this incorrect annotation.
In this file, select is imported from {dplyr}, but the file syntax is incorrect because of the if else,
library(dplyr)
select(mtcars[1, ], mpg)
if else
and it gets this incorrect annotation
library(dplyr) # No used functions found
select(mtcars[1, ], mpg)
if else
I think we should show an error instead of returning this wrong annotation.
Ideally, we should ignore the unparsable code, but I don't have an idea on how to build this annotator without parsing the script.
good find! never even thought of what would happen if the code had problems and couldn't be parsed. I agree that throwing an error is preferable. merging!
I found a bug with
annotate_fun_calls
, if the R code has wrong syntax (unparsable code), then the annotated adds "# No used functions found" instead of avoiding this incorrect annotation.In this file,
select
is imported from{dplyr}
, but the file syntax is incorrect because of theif else
,and it gets this incorrect annotation
I think we should show an error instead of returning this wrong annotation. Ideally, we should ignore the unparsable code, but I don't have an idea on how to build this annotator without parsing the script.