-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
Currently styler
appears inconsistent w.r.t. vertical whitespace.
Compare:
# leading/trailing whitespace is removed
styler::style_text('
function(x) {
return(x)
}
')
# function(x) {
# return(x)
# }
# no change
styler::style_text('
foo <- function(x) {
}
# foo <- function(x) {
#
# }
')
# leading whitespace is unchanged
styler::style_text('
foo <- function(a) {
# comment
return(a)
}
# foo <- function(a) {
#
# # comment
# return(a)
# }
')
PS the tidyverse guide is currently silent on any rules here, so inconsistency is the only per se issue with styler
. I have filed tidyverse/style#185 to try and nudge the guide to be more explicit here.