Skip to content

Commit

Permalink
Run globalVariables in a tryCatch
Browse files Browse the repository at this point in the history
This avoids an error if the package is not installed on the system
  • Loading branch information
jimhester committed Oct 1, 2019
1 parent e32d6aa commit 1237fab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/object_usage_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object_usage_linter <- function(source_file) {
}
env <- new.env(parent = parent_env)

declared_globals <- utils::globalVariables(package = pkg_name %||% globalenv())
declared_globals <- try_silently(utils::globalVariables(package = pkg_name %||% globalenv()))

symbols <- get_assignment_symbols(source_file$xml_parsed_content)

Expand Down

0 comments on commit 1237fab

Please sign in to comment.