@@ -119,21 +119,24 @@ tidyverse_style <- function(scope = "tokens",
119119 if (strict ) remove_line_break_before_round_closing_after_curly ,
120120 remove_line_break_before_round_closing_fun_dec =
121121 if (strict ) remove_line_break_before_round_closing_fun_dec ,
122- style_line_break_around_curly = partial(style_line_break_around_curly ,
122+ style_line_break_around_curly = partial(
123+ style_line_break_around_curly ,
123124 strict
124125 ),
125126 # must be after style_line_break_around_curly as it remove line
126127 # breaks again for {{.
127128 set_line_break_around_curly_curly ,
128- set_line_break_after_opening_if_call_is_multi_line = if (strict )
129+ set_line_break_after_opening_if_call_is_multi_line = if (strict ) {
129130 partial(
130131 set_line_break_after_opening_if_call_is_multi_line ,
131132 except_token_after = " COMMENT" ,
132133 except_text_before = c(" switch" , " ifelse" , " if_else" )
133- ),
134+ )
135+ },
134136 set_line_break_before_closing_call = if (strict ) {
135137 partial(
136- set_line_break_before_closing_call , except_token_before = " COMMENT"
138+ set_line_break_before_closing_call ,
139+ except_token_before = " COMMENT"
137140 )
138141 },
139142 remove_line_break_in_empty_fun_call ,
@@ -160,19 +163,19 @@ tidyverse_style <- function(scope = "tokens",
160163 update_indention_ref_fun_dec =
161164 if (scope > = " indention" ) update_indention_ref_fun_dec
162165 )
163-
166+ style_guide_name <- " styler::tidyverse_style@https://github.com/r-lib "
164167 create_style_guide(
165168 # transformer functions
166169 initialize = default_style_guide_attributes ,
167- line_break = line_break_manipulators ,
168- space = space_manipulators ,
169- token = token_manipulators ,
170- indention = indention_modifier ,
170+ line_break = line_break_manipulators ,
171+ space = space_manipulators ,
172+ token = token_manipulators ,
173+ indention = indention_modifier ,
171174 # transformer options
172- use_raw_indention = use_raw_indention ,
173- reindention = reindention ,
174- style_guide_name = " styler::tidyverse_style@https://github.com/r-lib " ,
175- style_guide_version = styler_version
175+ use_raw_indention = use_raw_indention ,
176+ reindention = reindention ,
177+ style_guide_name = style_guide_name ,
178+ style_guide_version = styler_version
176179 )
177180}
178181
@@ -267,12 +270,13 @@ NULL
267270# ' @export
268271specify_reindention <- function (regex_pattern = NULL ,
269272 indention = 0 ,
270- comments_only = TRUE )
273+ comments_only = TRUE ) {
271274 lst(
272275 regex_pattern ,
273276 indention ,
274277 comments_only
275278 )
279+ }
276280
277281# ' @describeIn reindention Simple forwarder to
278282# ' `specify_reindention` with reindention according to the tidyverse style
330334# ' @export
331335specify_math_token_spacing <-
332336 function (zero = " '^'" ,
333- one = c(" '+'" , " '-'" , " '*'" , " '/'" )) {
337+ one = c(" '+'" , " '-'" , " '*'" , " '/'" )) {
334338 assert_tokens(c(one , zero ))
335339 lst(
336340 one = setdiff(c(math_token , one ), zero ),
0 commit comments