styler
styler copied to clipboard
R6 methods don't allow double-indented formals?
The following should be allowed (ref: https://style.tidyverse.org/functions.html#long-lines-1 doesn't mention R6):
R6Class("MyClass",
public = list(
param = NULL,
initialize = function(
my_long_parameter = getOption("default_long_parameter", 1)) {
self$param <- my_long_parameter
}
)
)
But it's currently re-styled (style_text()
output):
R6Class("MyClass",
public = list(
param = NULL,
initialize = function(my_long_parameter = getOption("default_long_parameter", 1)) {
self$param <- my_long_parameter
}
)
)
Which of course creates an over-full line.
Right… but I think in your example, you only put one level of indention. Shouldn’t it be
R6Class("MyClass",
public = list(
param = NULL,
initialize = function(
my_long_parameter = getOption("default_long_parameter", 1)) {
self$param <- my_long_parameter
}
)
)
ah yes, my mistake. edited in the description
Seems like detection of double indention is based on the absolute indention of the formals, instead of the relative...