Skip to content
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

Require rlang 1.0.1 #512

Merged
merged 5 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Imports:
fansi,
glue,
lifecycle,
rlang (>= 0.3.0),
rlang (>= 1.0.1),
utf8 (>= 1.1.0),
utils,
vctrs (>= 0.3.8)
Expand Down
51 changes: 51 additions & 0 deletions R/compat-lifecycle.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# nocov start - compat-lifecycle (last updated: rlang 0.3.0.9000)

scoped_lifecycle_silence <- function(frame = rlang::caller_env()) {
rlang::local_options(
.frame = frame,
lifecycle_verbosity = "quiet"
)
}
with_lifecycle_silence <- function(expr) {
scoped_lifecycle_silence()
expr
}

scoped_lifecycle_warnings <- function(frame = rlang::caller_env()) {
rlang::local_options(
.frame = frame,
lifecycle_verbosity = "warning"
)
}
with_lifecycle_warnings <- function(expr) {
scoped_lifecycle_warnings()
expr
}

scoped_lifecycle_errors <- function(frame = rlang::caller_env()) {
rlang::local_options(
.frame = frame,
lifecycle_verbosity = "error"
)
}
with_lifecycle_errors <- function(expr) {
scoped_lifecycle_errors()
expr
}

# Enable once signal_superseded() reaches stable state
signal_superseded <- function(...) {}

foreign_caller_env <- function(my_env = ns_env()) {
for (n in 2:10) {
caller <- caller_env(n)
if (!is_reference(env_parent(caller), my_env)) {
return(caller)
}
}

# Safety net
caller
}

# nocov end
10 changes: 2 additions & 8 deletions tests/testthat/_snaps/ansi/format_multi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
Output
[1] "\033[31m-1\033[39m"

---

Code
style_na("NA")
Output
[1] "\033[31mNA\033[39m"

---

Code
Expand Down Expand Up @@ -119,7 +112,8 @@

Code
colonnade(list(a_very_long_column_name = 0), width = 15)
Warning <lifecycle_warning_deprecated>
Condition
Warning:
`colonnade()` was deprecated in pillar 1.7.0.
Please use `tbl_format_setup()` instead.
Output
Expand Down
Loading