Skip to content

Commit 0c7e298

Browse files
committed
remove spaces even for strict = FALSE
1 parent 2758fd7 commit 0c7e298

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

R/rules-spacing.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ set_space_around_op <- function(pd_flat) {
2727
#' @param zero Character vector of tokens that should be surrounded with zero
2828
#' spaces.
2929
style_space_around_math_token <- function(strict, zero, one, pd_flat) {
30+
# We remove spaces for zero (e.g., around ^ in the tidyverse style guide)
31+
# even for strict = FALSE to be consistent with the : operator
3032
pd_flat %>%
31-
style_space_around_token(strict, zero, 0L) %>%
32-
style_space_around_token(strict, one, 1L)
33+
style_space_around_token(strict = TRUE, zero, 0L) %>%
34+
style_space_around_token(strict = strict, one, 1L)
3335
}
3436

3537
#' Set spacing of token to a certain level
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1 + +1 - 3 / 23 * 3 ^4
1+
1 + +1 - 3 / 23 * 3^4

0 commit comments

Comments
 (0)