-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds trust parameter with deprecation for default #409
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,16 @@ escape_xml <- function(x, replacement = c("&", """, "<", ">", "&a | |
} | ||
return(file) | ||
} | ||
|
||
.check_trust <- function(trust, format) { | ||
lifecycle::deprecate_warn( | ||
when = "2.0.0", | ||
what = "import(trust)", | ||
details = paste0("Trust will be set to FALSE by default for ", format, ".") | ||
) | ||
if (isFALSE(trust)) { | ||
stop(format, "files may execute arbitary code. Only load", format, "files that you personally generated or can trust the origin.", call. = FALSE) | ||
} | ||
NULL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used this from review example provided, but curious if an explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can choose is.null((function() { NULL })())
#> [1] TRUE
is.null((function() { })())
#> [1] TRUE
is.null((function() { return() })())
#> [1] TRUE
is.null((function() { invisible() })())
#> [1] TRUE Created on 2024-05-12 with reprex v2.1.0 |
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a minor formatting point (4 SPCs). I can fix it later.