Skip to content

Commit 8373f37

Browse files
committed
update default in API
1 parent 5d32cf8 commit 8373f37

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

API

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

55
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)
7-
specify_math_token_spacing(zero = NULL, one = c("'+'", "'-'", "'*'", "'/'", "'^'"))
7+
specify_math_token_spacing(zero = "'^'", one = c("'+'", "'-'", "'*'", "'/'"))
88
specify_reindention(regex_pattern = NULL, indention = 0, comments_only = TRUE)
99
style_dir(path = ".", ..., style = tidyverse_style, transformers = style(...), filetype = "R", recursive = TRUE, exclude_files = NULL)
1010
style_file(path, ..., style = tidyverse_style, transformers = style(...))

R/style_guides.R

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,15 @@ character_to_ordered <- function(x, levels, name = substitute(x)) {
289289
#' math_token_spacing = specify_math_token_spacing(zero = "'+'"),
290290
#' strict = TRUE
291291
#' )
292-
#' style_text(
293-
#' "1+1 -3",
294-
#' math_token_spacing = tidyverse_math_token_spacing(),
295-
#' strict = TRUE
296-
#' )
297292
#' @name math_token_spacing
298293
NULL
299294

300295
#' @describeIn math_token_spacing Allows to fully specify the math token
301296
#' spacing.
302297
#' @export
303298
specify_math_token_spacing <-
304-
function(zero = NULL,
305-
one = c("'+'", "'-'", "'*'", "'/'", "'^'")) {
299+
function(zero = "'^'",
300+
one = c("'+'", "'-'", "'*'", "'/'")) {
306301
assert_tokens(c(one, zero))
307302
lst(
308303
one = setdiff(c(math_token, one), zero),
@@ -317,9 +312,17 @@ specify_math_token_spacing <-
317312
#' style_text(
318313
#' "1+1 -3",
319314
#' math_token_spacing = tidyverse_math_token_spacing(),
315+
#' strict = FALSE
316+
#' )
317+
#' style_text(
318+
#' "1+1 -3",
319+
#' math_token_spacing = tidyverse_math_token_spacing(),
320320
#' strict = TRUE
321321
#' )
322322
#' @export
323323
tidyverse_math_token_spacing <- function() {
324-
specify_math_token_spacing(one = math_token_lo)
324+
specify_math_token_spacing(
325+
zero = "'^'",
326+
one = c("'+'", "'-'", "'*'", "'/'")
327+
)
325328
}

R/token-define.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ token <- tribble(
2727
)
2828

2929
math_token <- token$token[token$class == "math"]
30-
math_token_lo <- setdiff(math_token, "^")
3130
logical_token <- token$token[token$class == "logical"]
3231
left_assignment_token <- token$token[token$class == "assign_left"]
3332
right_assignment_token <- token$token[token$class == "assign_right"]

man/math_token_spacing.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)