Open krlmlr opened 1 month ago
We should update the style guide IMO
I'm partial to the codegrip approach. FWIW I know this point came up in the original discussion.
Another thing to change in the style guide is double indent of arguments, it should be single indent (same as body).
I'm sorry to have advocated so much for the google style at the time, only to then change my mind :-)
After having worked with typescript and rust @DavisVaughan and I now think we should be consistent with the widespread style habits in these communities.
i.e. in the Double-indent
section here https://style.tidyverse.org/functions.html#long-lines-1, when we also update recommendations for placement of ) {
it should be this:
mcmc_derive_fun <- function(
object,
new_data = data_set(object),
new_expr = NULL,
...
) {
body
}
not
mcmc_derive_fun <- function(
object,
new_data = data_set(object),
new_expr = NULL,
...
) {
body
}
@lionel- codegrip needs an update to fix that too right? I think it currently does the double indent, opened https://github.com/lionel-/codegrip/issues/20
There's a disagreement between codegrip and the style guide (and styler). I can't find the original discussion but wanted to raise this here.
@lionel- considers the codegrip style to be the better one, I agree. What do you think, @hadley and @MichaelChirico?
codegrip
Style guide