diff --git a/R/lifecycle_admiral.R b/R/lifecycle_admiral.R index 21db1c93..c3e63ff7 100644 --- a/R/lifecycle_admiral.R +++ b/R/lifecycle_admiral.R @@ -2,7 +2,11 @@ #' #' Wrapper around `lifecycle::deprecate_soft()`. #' -#' @param ... See documentation for `lifecycle::deprecate_soft()` for argument use. +#' @param env See documentation for `lifecycle::deprecate_soft()`. +#' +#' @param user_env See documentation for `lifecycle::deprecate_soft()`. +#' +#' @param ... See documentation for `lifecycle::deprecate_soft()` for additional argument use. #' #' @return `NULL`, invisibly. #' @@ -25,7 +29,10 @@ #' @export deprecate_inform <- function(...) { tryCatch( - lifecycle::deprecate_soft(...), + lifecycle::deprecate_soft( + env = caller_env(), + user_env = caller_env(), + ...), warning = \(w) { message(conditionMessage(w)) tryInvokeRestart("muffleWarning") diff --git a/man/deprecate_inform.Rd b/man/deprecate_inform.Rd index bc8b4ec8..362d6806 100644 --- a/man/deprecate_inform.Rd +++ b/man/deprecate_inform.Rd @@ -7,7 +7,11 @@ deprecate_inform(...) } \arguments{ -\item{...}{See documentation for \code{lifecycle::deprecate_soft()} for argument use.} +\item{...}{See documentation for \code{lifecycle::deprecate_soft()} for additional argument use.} + +\item{env}{See documentation for \code{lifecycle::deprecate_soft()}.} + +\item{user_env}{See documentation for \code{lifecycle::deprecate_soft()}.} } \value{ \code{NULL}, invisibly. diff --git a/vignettes/programming_strategy.Rmd b/vignettes/programming_strategy.Rmd index f69d2fda..8f384b9d 100644 --- a/vignettes/programming_strategy.Rmd +++ b/vignettes/programming_strategy.Rmd @@ -650,10 +650,9 @@ fun_xxx <- function(dataset, some_param, other_param) { https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation" ) ) - function( dataset = dataset, some_param = some_param, - other_param = other_param) + other_param = other_param } ``` **Phase 2:** In the next year/closest release in which a function is deprecated @@ -662,7 +661,7 @@ the call to `deprecate_inform()` must be replaced with a call to `deprecate_warn ```r fun_xxx <- function(dataset, some_param, other_param) { deprecate_warn("x.y.z", "fun_xxx()", "new_fun_xxx()") - new_fun_xxx( + fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param