From 1f927012e386308d89853c11f4c9cc5b79f77b56 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 16 Sep 2022 20:42:14 +0200 Subject: [PATCH] `object_usage_linter()` ft. `useFancyQuotes=FALSE` (#1523) Closes #1498 --- R/object_usage_linter.R | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/R/object_usage_linter.R b/R/object_usage_linter.R index 02b1a947e..a02c9c8c9 100644 --- a/R/object_usage_linter.R +++ b/R/object_usage_linter.R @@ -198,12 +198,17 @@ parse_check_usage <- function(expression, known_used_symbols = character(), decl vals[[length(vals) + 1L]] <<- x } - try(codetools::checkUsage( - expression, - report = report, - suppressLocalUnused = known_used_symbols, - suppressUndefined = declared_globals - )) + withr::with_options( + list(useFancyQuotes = FALSE), + code = { + try(codetools::checkUsage( + expression, + report = report, + suppressLocalUnused = known_used_symbols, + suppressUndefined = declared_globals + )) + } + ) function_name <- rex(anything, ": ") line_info <- rex(" ", "(", capture(name = "path", non_spaces), ":",