fn <- function() {
lifecycle::deprecate_soft("0.1.0", "fn()", "fn2()")
1
}
rlang::with_options(lifecycle_verbosity = "warning", {
fn()
})
#> Warning: `fn()` was deprecated in <NA> 0.1.0.
#> Please use `fn2()` instead.
#> [1] 1
# why doesn't this error?
rlang::with_options(lifecycle_verbosity = "error", {
fn()
})
#> Warning: `fn()` was deprecated in <NA> 0.1.0.
#> Please use `fn2()` instead.
#> [1] 1
I think the logic in deprecate_soft() is a little wrong. If I request verbosity = "error", then I think that should take precedence over env_inherits_global(user_env).
|
} else if (verbosity %in% "warning" || env_inherits_global(user_env)) { |
I think the logic in
deprecate_soft()is a little wrong. If I requestverbosity = "error", then I think that should take precedence overenv_inherits_global(user_env).lifecycle/R/deprecated.R
Line 103 in 19781f7