observed
Here I am deliberately adding a single, double, or triple spaces surrounding the argument assignment (=), but, when styled, {styler} preserves these spaces.
styler::style_text(
'df <- dplyr::rename(df,
"xValues" = "Time",
"xUnit" = "TimeUnit",
"yValues" = "simulationValues",
"yUnit" = "unit",
"yDimension" = "dimension"
)'
)
#> df <- dplyr::rename(df,
#> "xValues" = "Time",
#> "xUnit" = "TimeUnit",
#> "yValues" = "simulationValues",
#> "yUnit" = "unit",
#> "yDimension" = "dimension"
#> )
Created on 2021-12-23 by the reprex package (v2.0.1)
expected
I would have expected that it would instead always have a single space surrounding assignment. Can this be supported?
df <- dplyr::rename(df,
"xValues" = "Time",
"xUnit" = "TimeUnit",
"yValues" = "simulationValues",
"yUnit" = "unit",
"yDimension" = "dimension"
)
No changes in case alignment is detected
Of course, the feature request is relevant only in case no alignment is detected, since then the spaces are deliberate and shouldn't be changed.
styler::style_text(
'df <- dplyr::rename(df,
"xValues" = "Time",
"xUnit" = "TimeUnit",
"yValues" = "simulationValues",
"yUnit" = "unit",
"yDimension" = "dimension"
)'
)
#> df <- dplyr::rename(df,
#> "xValues" = "Time",
#> "xUnit" = "TimeUnit",
#> "yValues" = "simulationValues",
#> "yUnit" = "unit",
#> "yDimension" = "dimension"
#> )
Created on 2021-12-23 by the reprex package (v2.0.1)
observed
Here I am deliberately adding a single, double, or triple spaces surrounding the argument assignment (
=), but, when styled,{styler}preserves these spaces.Created on 2021-12-23 by the reprex package (v2.0.1)
expected
I would have expected that it would instead always have a single space surrounding assignment. Can this be supported?
No changes in case alignment is detected
Of course, the feature request is relevant only in case no alignment is detected, since then the spaces are deliberate and shouldn't be changed.
Created on 2021-12-23 by the reprex package (v2.0.1)