Skip to content

Commit 5ec1cc6

Browse files
Revert "no more than one line break between pipes"
This reverts commit e7af91a.
1 parent e7af91a commit 5ec1cc6

File tree

4 files changed

+3
-23
lines changed

4 files changed

+3
-23
lines changed

R/rules-line-break.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,8 @@ remove_line_breaks_in_fun_dec <- function(pd) {
182182

183183
#' @importFrom rlang seq2
184184
add_line_break_after_pipe <- function(pd) {
185-
is_pipe <- pd$token == c("SPECIAL-PIPE")
186-
pd$lag_newlines[lag(is_pipe) & pd$lag_newlines > 1] <- 1L
187-
188-
if (sum(is_pipe & pd$token_after != "COMMENT") > 1 &&
185+
is_pipe <- pd$token == c("SPECIAL-PIPE") & pd$token_after != "COMMENT"
186+
if (sum(is_pipe) > 1 &&
189187
!(next_terminal(pd, vars = "token_before")$token_before %in% c("'('", "EQ_SUB", "','"))) {
190188
pd$lag_newlines[lag(is_pipe)] <- 1L
191189
}

tests/testthat/indention_operators/pipe_simple-in.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,3 @@ c() %>%
55
g_out()
66

77
a <- function(jon_the_pipe) {}
8-
9-
x %>%
10-
11-
# break
12-
call()
13-
14-
15-
y %>%
16-
17-
18-
call() # mor

tests/testthat/indention_operators/pipe_simple-out.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ a %>%
55
g_out()
66

77
a <- function(jon_the_pipe) {}
8-
9-
x %>%
10-
# break
11-
call()
12-
13-
14-
y %>%
15-
call() # mor

tests/testthat/line_breaks_and_other/pipe-line-breaks-out.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fun(
8282

8383
# FIXME closing brace could go on ntext line. Alternative: remove lin breaks completely.
8484
blew(x %>%
85+
8586
c(), y = 2)
8687

8788
# FIXME closing brace could go on ntext line. Alternative: move c() up.

0 commit comments

Comments
 (0)