lint(linters = object_usage_linter(), "
foo <- function() {
`%++%` <- `+`
glue('{x %++% y}')
}")
# <text>:3:3: warning: [object_usage_linter] local variable '%++%' assigned but may not be used
# `%++%` <- `+`
# ^~~~~~
The problem is we only look for SYMBOL or SYMBOL_FUNCTION_CALL in the parse tree of the glue expression:
|
symbols <- gsub("^`(.*)`$", "\\1", parse_data$text[parse_data$token %in% c("SYMBOL", "SYMBOL_FUNCTION_CALL")]) |
#2068 already fixed this by using all.vars() instead.
The problem is we only look for
SYMBOLorSYMBOL_FUNCTION_CALLin the parse tree of the glue expression:lintr/R/object_usage_linter.R
Line 225 in 2813b6d
#2068 already fixed this by using
all.vars()instead.