Skip to content

Commit 3edce7e

Browse files
revert breaking API change
and convert initialize internally to a list of one function.
1 parent 7e8b667 commit 3edce7e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

API

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Exported functions
44

5-
create_style_guide(initialize = lst(default_style_guide_attributes), line_break = NULL, space = NULL, token = NULL, indention = NULL, use_raw_indention = FALSE, reindention = tidyverse_reindention())
5+
create_style_guide(initialize = default_style_guide_attributes, line_break = NULL, space = NULL, token = NULL, indention = NULL, use_raw_indention = FALSE, reindention = tidyverse_reindention())
66
default_style_guide_attributes(pd_flat)
77
specify_math_token_spacing(zero = NULL, one = c("'+'", "'-'", "'*'", "'/'", "'^'"))
88
specify_reindention(regex_pattern = NULL, indention = 0, comments_only = TRUE)

R/style_guides.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ tidyverse_style <- function(scope = "tokens",
139139

140140
indention_modifier <-
141141
lst(
142-
update_indention_ref_fun_dec =
142+
update_indention_ref_fun_dec =
143143
if (scope >= "indention") update_indention_ref_fun_dec
144144
)
145145

146146
create_style_guide(
147147
# transformer functions
148-
initialize = lst(default_style_guide_attributes),
148+
initialize = default_style_guide_attributes,
149149
line_break = line_break_manipulators,
150150
space = space_manipulators,
151151
token = token_manipulators,
@@ -163,7 +163,7 @@ tidyverse_style <- function(scope = "tokens",
163163
#' transformer function corresponds to one styling rule. The output of this
164164
#' function can be used as an argument for \code{style} in top level functions
165165
#' like [style_text()] and friends.
166-
#' @param initialize A list of functions that initializes various
166+
#' @param initialize The bare name of a function that initializes various
167167
#' variables on each level of nesting.
168168
#' @param line_break A list of transformer functions that manipulate line_break
169169
#' information.
@@ -187,7 +187,7 @@ tidyverse_style <- function(scope = "tokens",
187187
#' style_text("a <- function(x) { x }", style = set_line_break_before_curly_opening_style)
188188
#' @importFrom purrr compact
189189
#' @export
190-
create_style_guide <- function(initialize = lst(default_style_guide_attributes),
190+
create_style_guide <- function(initialize = default_style_guide_attributes,
191191
line_break = NULL,
192192
space = NULL,
193193
token = NULL,
@@ -196,7 +196,7 @@ create_style_guide <- function(initialize = lst(default_style_guide_attributes),
196196
reindention = tidyverse_reindention()) {
197197
lst(
198198
# transformer functions
199-
initialize,
199+
initialize = lst(initialize),
200200
line_break,
201201
space,
202202
token,

man/create_style_guide.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)