Skip to content

Commit 302da1e

Browse files
authored
Merge pull request #378 from tidymodels:check-dots-parameters-list
Enforce empty dots for `parameters.list()`
2 parents 4f58916 + 7b68c07 commit 302da1e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
* The constructors, `new_*_parameter()`, now label unlabeled parameter (i.e., constructed with `label = NULL`) as such (#349).
1717

18+
* `parameters.list()` now enforces the unused ellipsis to be empty (#378).
19+
1820
## Breaking changes
1921

2022
* The `grid_*()` functions now error instead of warn when provided with the wrong argument to control the grid size. So `grid_space_filling()`, `grid_random()`, `grid_max_entropy()`, and `grid_latin_hypercube()` now error if used with a `levels` argument and `grid_regular()` now errors if used with a `size` argument (#368).

R/parameters.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ parameters.param <- function(x, ...) {
2929
#' @export
3030
#' @rdname parameters
3131
parameters.list <- function(x, ...) {
32+
check_dots_empty()
33+
3234
elem_param <- purrr::map_lgl(x, inherits, "param")
3335
if (any(!elem_param)) {
3436
cli::cli_abort("The objects should all be {.cls param} objects.")
3537
}
36-
elem_name <- purrr::map_chr(x, ~ names(.x$label))
38+
elem_name <- purrr::map_chr(x, ~names(.x$label))
3739
elem_id <- names(x)
3840
if (length(elem_id) == 0) {
3941
elem_id <- elem_name

0 commit comments

Comments
 (0)