From 43fa650441591b5cfc80a232c056592decdf4114 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Thu, 3 Nov 2022 19:17:30 +0100 Subject: [PATCH] rename the not exported set_linebreak_after_ggplot2_plus to be consistent --- R/rules-line-breaks.R | 2 +- R/style-guides.R | 4 ++-- tests/testthat/test-transformers-drop.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/rules-line-breaks.R b/R/rules-line-breaks.R index 705e52a2e..93ec4780f 100644 --- a/R/rules-line-breaks.R +++ b/R/rules-line-breaks.R @@ -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)) { diff --git a/R/style-guides.R b/R/style-guides.R index 10f8fffb8..fb08fd224 100644 --- a/R/style-guides.R +++ b/R/style-guides.R @@ -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 } ) } diff --git a/tests/testthat/test-transformers-drop.R b/tests/testthat/test-transformers-drop.R index bad49dab1..2691da757 100644 --- a/tests/testthat/test-transformers-drop.R +++ b/tests/testthat/test-transformers-drop.R @@ -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)