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
If I start a new R session and call lintr::lint("test.R"), I get a marker related to the second map ("no visible global function definition"), whereas if I call library(purrr) first, I do not get a marker.
Why do I never get a marker for the first map?
In the second case (i.e., if I call lintr::lint after library), how does lintr "knows" that map is "available"?
While I ask the first question by curiosity, I ask the second question because, as mentioned, I use ale and Nvim-R. In this context, although I often load packages in the R session opened with Nvim-R, the markers for missing global function definitions never disappear after loading the appropriate packages.
This is obviously expected since, to the best of my knowledge, there is no connection between ale and Nvim-R. But I am trying to understand where lintr looks for the information about the loaded namespaces with the final goal to get ale to use the current Nvim-R session to make the markers related to global function definitions from packages that are loaded disappear.
I am not sure whether I explained clearly the issue, my apologies if not.
The text was updated successfully, but these errors were encountered:
ale is calling lintr in a new process, not the current process. Probably we should be loading libraries as well, but lintr is currently mostly geared towards package development rather than scripts unfortunately.
Actually, my two remarks/questions still stand. I just tried Rscript -e 'lintr::lint("test.R")' vs Rscript -e 'library(purrr);lintr::lint("test.R")' using the file above, and I get exactly the same "issue" as before:
With Rscript -e 'lintr::lint("test.R")': no marker related to the first map, but a marker related to the second.
With Rscript -e 'library(purrr);lintr::lint("test.R")': no marker related to either map.
Hi,
I use neovim with ale + Nvim-R and it got me wondering about how lintr works.
Let's say that I have the following file called
test.R
:If I start a new R session and call
lintr::lint("test.R")
, I get a marker related to the second map ("no visible global function definition"), whereas if I calllibrary(purrr)
first, I do not get a marker.map
?lintr::lint
afterlibrary
), how doeslintr
"knows" thatmap
is "available"?While I ask the first question by curiosity, I ask the second question because, as mentioned, I use ale and Nvim-R. In this context, although I often load packages in the R session opened with Nvim-R, the markers for missing global function definitions never disappear after loading the appropriate packages.
This is obviously expected since, to the best of my knowledge, there is no connection between ale and Nvim-R. But I am trying to understand where
lintr
looks for the information about the loaded namespaces with the final goal to get ale to use the current Nvim-R session to make the markers related to global function definitions from packages that are loaded disappear.I am not sure whether I explained clearly the issue, my apologies if not.
The text was updated successfully, but these errors were encountered: