Skip to content

Commit 1237fab

Browse files
committed
Run globalVariables in a tryCatch
This avoids an error if the package is not installed on the system
1 parent e32d6aa commit 1237fab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/object_usage_linter.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object_usage_linter <- function(source_file) {
2424
}
2525
env <- new.env(parent = parent_env)
2626

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

2929
symbols <- get_assignment_symbols(source_file$xml_parsed_content)
3030

0 commit comments

Comments
 (0)