Skip to content

Commit

Permalink
object_usage_linter() ft. useFancyQuotes=FALSE (#1523)
Browse files Browse the repository at this point in the history
Closes #1498
  • Loading branch information
IndrajeetPatil authored Sep 16, 2022
1 parent 8013786 commit 1f92701
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions R/object_usage_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -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), ":",
Expand Down

0 comments on commit 1f92701

Please sign in to comment.