Skip to content

Commit

Permalink
address comments move back error_arg down
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy authored and lionel- committed Oct 25, 2024
1 parent d3ed1fd commit d61cd64
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
8 changes: 4 additions & 4 deletions R/eval-relocate.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ eval_relocate <- function(expr,
allow_predicates = TRUE,
before_arg = "before",
after_arg = "after",
error_arg = NULL,
env = caller_env(),
error_arg = NULL,
error_call = caller_env()) {
check_dots_empty()

Expand All @@ -89,8 +89,8 @@ eval_relocate <- function(expr,
allow_rename = allow_rename,
allow_empty = allow_empty,
allow_predicates = allow_predicates,
error_arg = error_arg,
type = "relocate",
error_arg = error_arg,
error_call = error_call
)

Expand Down Expand Up @@ -125,7 +125,7 @@ eval_relocate <- function(expr,
error_call = error_call,
allow_predicates = allow_predicates,
allow_rename = FALSE,
error_arg = before_arg
error_arg = error_arg
),
arg = before_arg,
error_call = error_call
Expand All @@ -147,7 +147,7 @@ eval_relocate <- function(expr,
error_call = error_call,
allow_predicates = allow_predicates,
allow_rename = FALSE,
error_arg = after_arg
error_arg = error_arg
),
arg = after_arg,
error_call = error_call
Expand Down
7 changes: 3 additions & 4 deletions R/eval-select.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#' support predicates (as determined by [tidyselect_data_has_predicates()]).
#' @param error_arg Argument names for `expr`. These
#' are used in error messages. (You can use `"..."` if `expr = c(...)`).
#' For now, this is used when `allow_empty = FALSE` or `allow_rename = FALSE`.
#' @inheritParams rlang::args_dots_empty
#'
#' @return A named vector of numeric locations, one for each of the
Expand Down Expand Up @@ -174,8 +173,8 @@ eval_select_impl <- function(x,
allow_rename = TRUE,
allow_empty = TRUE,
allow_predicates = TRUE,
error_arg = NULL,
type = "select",
error_arg = NULL,
error_call = caller_env()) {
if (!is_null(x)) {
vctrs::vec_assert(x)
Expand All @@ -201,8 +200,8 @@ eval_select_impl <- function(x,
allow_rename = allow_rename,
allow_empty = allow_empty,
allow_predicates = allow_predicates,
error_arg = error_arg,
type = type,
error_arg = error_arg,
error_call = error_call
),
type = type
Expand All @@ -229,7 +228,7 @@ eval_select_impl <- function(x,

if (length(exclude) > 0) {
if (!is.character(exclude)) {
cli::cli_abort("{.arg include} must be a character vector.", call = error_call)
cli::cli_abort("{.arg exclude} must be a character vector.", call = error_call)
}

to_exclude <- vctrs::vec_match(intersect(exclude, names), names)
Expand Down
9 changes: 4 additions & 5 deletions man/eval_relocate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/eval_select.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/eval-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
select_loc(x, "a", exclude = 1)
Condition <rlang_error>
Error in `select_loc()`:
! `include` must be a character vector.
! `exclude` must be a character vector.

# can forbid rename syntax (#178)

Expand Down

0 comments on commit d61cd64

Please sign in to comment.