Skip to content

Commit

Permalink
Use "In argument" bullet
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Oct 28, 2024
1 parent df589bc commit f885116
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions R/eval-walk.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,18 @@ ensure_named <- function(pos,

if (!allow_rename && any(names2(pos) != "")) {
if (is.null(error_arg)) {
cli::cli_abort(
"Can't rename variables in this context.",
class = "tidyselect_error_cannot_rename",
call = call
)
i <- NULL
} else {
cli::cli_abort(
c(
"Can't rename variables in this context.",
i = "{.arg {error_arg}} can't be renamed."
),
class = "tidyselect_error_cannot_rename",
call = call
)
i <- cli::format_inline("In argument: {.arg {error_arg}}.")
}
abort(
c(
"Can't rename variables in this context.",
i = i
),
class = "tidyselect_error_cannot_rename",
call = call
)
}

nms <- names(pos) <- names2(pos)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/eval-relocate.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
Condition <tidyselect_error_cannot_rename>
Error in `relocate_loc()`:
! Can't rename variables in this context.
i `...` can't be renamed.
i In argument: `...`.

# can forbid empty selections

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/eval-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
Condition <tidyselect_error_cannot_rename>
Error in `select_loc()`:
! Can't rename variables in this context.
i `x` can't be renamed.
i In argument: `x`.

# can forbid empty selections

Expand Down

0 comments on commit f885116

Please sign in to comment.