We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
indent_by
2
Problem: Changing indent_by configuration doesn't implement the same styling guides (on "Double-indent")
It changes the style to "Function-indent" (reference)
Reproducible code:
foo_2 <- "foo <- function( bar) { NULL }" foo_4 <- "foo <- function( bar) { NULL }" styler::style_text(foo_2) #> foo <- function( #> bar) { #> NULL #> } styler::style_text(foo_4, indent_by = 4L) #> foo <- function(bar) { #> NULL #> } styler::style_text(foo_4, transformers = styler::tidyverse_style(indent_by = 4)) #> foo <- function(bar) { #> NULL #> } testthat::expect_identical( foo_2 |> styler::style_text(indent_by = 2L) |> as.character() |> paste(collapse = "\n", sep = ""), foo_2 ) testthat::expect_identical( foo_4 |> styler::style_text(indent_by = 4L) |> as.character() |> paste(collapse = "\n", sep = ""), foo_4 ) #> Error: paste(...) not identical to `foo_4`. #> 1/1 mismatches #> x[1]: "foo <- function(bar) {\n NULL\n}" #> y[1]: "foo <- function(\n bar) {\n NULL\n}" # Sanity check using "tidyverse_style" testthat::expect_identical( foo_2 |> styler::style_text(transformers = styler::tidyverse_style(indent_by = 2L)) |> as.character() |> paste(collapse = "\n", sep = ""), foo_2 ) testthat::expect_identical( foo_4 |> styler::style_text(transformers = styler::tidyverse_style(indent_by = 4)) |> as.character() |> paste(collapse = "\n", sep = ""), foo_4 ) #> Error: paste(...) not identical to `foo_4`. #> 1/1 mismatches #> x[1]: "foo <- function(bar) {\n NULL\n}" #> y[1]: "foo <- function(\n bar) {\n NULL\n}"
Created on 2024-02-14 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
Acknowledging this, but won’t have capacity to work on it at the moment. Contributions welcome.
Sorry, something went wrong.
No branches or pull requests
Problem: Changing
indent_by
configuration doesn't implement the same styling guides (on "Double-indent")It changes the style to "Function-indent" (reference)
Reproducible code:
Created on 2024-02-14 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: