Skip to content

Commit

Permalink
Merge pull request #497 from r-lib/f-new-pillar-extra
Browse files Browse the repository at this point in the history
- `new_pillar()` loses `extra` argument, it is no longer supported (#497).
  • Loading branch information
krlmlr authored Feb 1, 2022
2 parents d3a7599 + 215c674 commit 1e96fc8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ importFrom(fansi,strip_sgr)
importFrom(fansi,substr2_ctl)
importFrom(glue,as_glue)
importFrom(lifecycle,deprecate_soft)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,is_present)
importFrom(utf8,utf8_width)
importFrom(utils,head)
importFrom(utils,str)
Expand Down
13 changes: 8 additions & 5 deletions R/ctl_pillar.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ rowidformat2 <- function(data, names, has_star) {
#' @inheritParams pillar
#' @param components A named list of components constructed with [pillar_component()].
#' @param class Name of subclass.
#' @param extra For compound pillars, indicate the names or indices of the
#' sub-pillars that could not be shown due to width constraints.
#' @param extra Deprecated.
#'
#' @export
#' @examples
Expand All @@ -161,9 +160,14 @@ rowidformat2 <- function(data, names, has_star) {
#' lines = new_pillar_component(list(lines("=")), width = 1)
#' ))
new_pillar <- function(components, ..., width = NULL, class = NULL,
extra = NULL) {
extra = deprecated()) {
"!!!!DEBUG new_pillar(`v(width)`, `v(class)`)"

if (is_present(extra)) {
# Signal the deprecation to the user
deprecate_warn("1.6.6", "pillar::new_pillar(extra = )")
}

check_dots_empty()
if (length(components) > 0 && !is_named(components)) {
abort("All components must have names.")
Expand All @@ -172,8 +176,7 @@ new_pillar <- function(components, ..., width = NULL, class = NULL,
structure(
components,
width = width,
class = c(class, "pillar"),
extra = extra
class = c(class, "pillar")
)
}

Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @import rlang
#' @import ellipsis
#' @importFrom glue as_glue
#' @importFrom lifecycle deprecate_soft
#' @importFrom lifecycle deprecate_soft deprecate_warn is_present deprecated
#' @importFrom vctrs data_frame
#' @importFrom vctrs new_data_frame
#' @importFrom vctrs new_list_of
Expand Down
5 changes: 2 additions & 3 deletions man/new_pillar.Rd

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

0 comments on commit 1e96fc8

Please sign in to comment.