Skip to content

Commit

Permalink
Closes #401 No longer implementing our own rlang::is_named() and no…
Browse files Browse the repository at this point in the history
…t exporting it (#428)

* in progress

* Update assertions.md

* Update NEWS.md

* #401 no_more_is_named: do not prefix is_named()

---------

Co-authored-by: Stefan Bundfuss <[email protected]>
  • Loading branch information
ddsjoberg and bundfussr authored Apr 11, 2024
1 parent 7fdcbe4 commit de40d79
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 46 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export(get_new_tmp_var)
export(get_source_vars)
export(inner_join)
export(is_auto)
export(is_named)
export(is_order_vars)
export(is_valid_dtc)
export(left_join)
Expand Down Expand Up @@ -166,6 +165,7 @@ importFrom(rlang,is_formula)
importFrom(rlang,is_integerish)
importFrom(rlang,is_logical)
importFrom(rlang,is_missing)
importFrom(rlang,is_named)
importFrom(rlang,is_quosure)
importFrom(rlang,is_symbol)
importFrom(rlang,is_symbolic)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

## Breaking Changes

* `renv` and related files have been removed (#360)
* `renv` and related files have been removed. (#360)

* No longer exporting `is_named()` function. (#401)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion R/admiraldev-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @importFrom magrittr %>%
#' @importFrom rlang := abort arg_match as_function as_label as_name as_string
#' call2 caller_env call_name current_env .data enexpr enquo eval_bare
#' eval_tidy expr expr_interp expr_label exprs f_lhs f_rhs inform missing_arg
#' eval_tidy expr expr_interp expr_label exprs f_lhs f_rhs is_named inform missing_arg
#' is_bare_formula is_call is_character is_expression is_formula is_integerish
#' is_logical is_missing is_quosure is_symbol is_symbolic new_formula
#' parse_expr parse_exprs quo quo_is_missing quo_is_null set_names sym syms
Expand Down
2 changes: 1 addition & 1 deletion R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ assert_named <- function(arg, optional = FALSE,
}

# if argument is greater than length 0 and all element named, return arg invisibly
any_unnamed <- length(arg) > 0L && !rlang::is_named(arg)
any_unnamed <- length(arg) > 0L && !is_named(arg)
if (isFALSE(any_unnamed)) {
return(invisible(arg))
}
Expand Down
14 changes: 0 additions & 14 deletions R/is.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#' Is a named argument
#'
#' @param x Any R object
#'
#' @return `TRUE` if the argument is named, `FALSE` otherwise
#' @export
#'
#' @keywords is
#' @family is
#' @export
is_named <- function(x) {
!is.null(names(x)) && all(names(x) != "")
}

#' Checks if the argument equals the auto keyword
#'
#' @param arg argument to check
Expand Down
1 change: 0 additions & 1 deletion man/is_auto.Rd

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

25 changes: 0 additions & 25 deletions man/is_named.Rd

This file was deleted.

1 change: 0 additions & 1 deletion man/is_order_vars.Rd

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

1 change: 0 additions & 1 deletion man/is_valid_dtc.Rd

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

0 comments on commit de40d79

Please sign in to comment.