Skip to content

Commit

Permalink
Merge pull request #1049 from Polkas/1048_setlinebreak
Browse files Browse the repository at this point in the history
Rename internal function `set_linebreak_after_ggplot2_plus()` to `set_line_break_after_ggplot2_plus()`
  • Loading branch information
IndrajeetPatil authored Nov 7, 2022
2 parents a995a35 + 43fa650 commit 29599f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/rules-line-breaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ remove_line_break_in_fun_call <- function(pd, strict) {
}


set_linebreak_after_ggplot2_plus <- function(pd) {
set_line_break_after_ggplot2_plus <- function(pd) {
# if expression is unary, first token is +. Exclude this case.
is_plus_raw <- c(FALSE, pd$token[-1L] == "'+'")
if (any(is_plus_raw)) {
Expand Down
4 changes: 2 additions & 2 deletions R/style-guides.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ tidyverse_style <- function(scope = "tokens",
strict = strict
),
add_line_break_after_pipe = if (strict) add_line_break_after_pipe,
set_linebreak_after_ggplot2_plus = if (strict) {
set_linebreak_after_ggplot2_plus
set_line_break_after_ggplot2_plus = if (strict) {
set_line_break_after_ggplot2_plus
}
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-transformers-drop.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test_that("tidyverse transformers are correctly dropped", {
"set_line_break_after_opening_if_call_is_multi_line",
"set_line_break_before_closing_call",
"remove_line_break_in_fun_call",
"set_linebreak_after_ggplot2_plus"
"set_line_break_after_ggplot2_plus"
)
expect_setequal(names(t_fun$line_break), names_line_break)

Expand Down

0 comments on commit 29599f1

Please sign in to comment.