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
str<-"foo <- function() {\n x\n}\n"
options(useFancyQuotes=FALSE)
lintr::lint(text=str, linters=lintr::object_usage_linter())
# <text>:2:3: warning: [object_usage_linter] no visible binding for global variable 'x'.# x# ^
options(useFancyQuotes=TRUE)
lintr::lint(text=str, linters=lintr::object_usage_linter())
# <text>:2:3: warning: [object_usage_linter] no visible binding for global variable ‘x’.# x# ^
I think we should follow suit of testthat and turn off quotes here -- makes the lint appear differently depending on global options & it's harder to manipulate the message with non-ASCII characters.
The fix is pretty trivial to implement; filing here first as a gut check that this is the right approach.
The text was updated successfully, but these errors were encountered:
That's basically right, but it's still something in our control that allows us to be more consistent. I don't think we use fancy quotes in any messages generated by us. And the fix is one line (wrap codetools call with with_options(list(useFancyQuotes = FALSE), ...))
IndrajeetPatil
changed the title
object_usage_linter should set useFancyQuotes=FALSEobject_usage_linter() should set useFancyQuotes=FALSEAug 29, 2022
Compare:
I think we should follow suit of
testthat
and turn off quotes here -- makes the lint appear differently depending on global options & it's harder to manipulate the message with non-ASCII characters.The fix is pretty trivial to implement; filing here first as a gut check that this is the right approach.
The text was updated successfully, but these errors were encountered: