Closed
Description
I tried to adjust a wide function declaration to use the new double-indented style:
# before
xxxxxxxxxx_xxxxxxxxxxx <- function(yyyyyyyyyy.yyyy = c(
"aaaaaaaaaa", "bbbbbbbbb", "cccc"
)) {
...
}
# after
xxxxxxxxxx_xxxxxxxxxxx <- function(
yyyyyyyyyy.yyyy = c("aaaaaaaaaa", "bbbbbbbbb", "cccc")) {
...
}
But under styler 1.9.0 this gets edited:
styler::style_text('
xxxxxxxxxx_xxxxxxxxxxx <- function(
yyyyyyyyyy.yyyy = c("aaaaaaaaaa", "bbbbbbbbb", "cccc")) {
...
}
')
# xxxxxxxxxx_xxxxxxxxxxx <- function(yyyyyyyyyy.yyyy = c("aaaaaaaaaa", "bbbbbbbbb", "cccc")) {
# ...
# }
AFAICT the after
style is style guide compliant (https://style.tidyverse.org/functions.html#long-lines-1); the key may be:
Prefer function-indent style to double-indent style when it fits.
Under the tidyverse guidance of 80 characters per line, the function doesn't"fit" in function-indent style, hence double-indenting is OK.
Metadata
Metadata
Assignees
Labels
No labels