Skip to content

feature request: removing empty lines in function argument specifications #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IndrajeetPatil opened this issue Jan 20, 2021 · 1 comment · Fixed by #723
Closed

feature request: removing empty lines in function argument specifications #716

IndrajeetPatil opened this issue Jan 20, 2021 · 1 comment · Fixed by #723

Comments

@IndrajeetPatil
Copy link
Collaborator

Feel free to close this if you feel the gain here is inconsequential for the work needed to support this feature, but I was expecting the following code

styler::style_text(
  "foo <- function(
                  a,
                  b = 2,
                  c = 3,
                  d = 4) {
    print('hi')
  }"
)
#> foo <- function(
#>                 a,
#>                 b = 2,
#>                 c = 3,
#>                 d = 4) {
#>   print("hi")
#> }

Created on 2021-01-20 by the reprex package (v0.3.0.9001)

to be styled as-

foo <- function(a,
                b = 2,
                c = 3,
                d = 4) {
  print("hi")
}

I couldn't find relevant discussion about this in the tidyverse style guide, but does that make sense to you?

@lorenzwalthert
Copy link
Collaborator

Makes complete sense. Actually kind of a duplicate of #549, but not covered in the associated PR (although specifically mentioned as an example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants