-
Notifications
You must be signed in to change notification settings - Fork 73
feature request: removing empty lines in function calls #627
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
Comments
I think this a reasonable suggestion. We can leave as is for |
Do you think the same can also be extended from function calls to the entire code? For example, here is a simple example where I think styler::style_text("
mtcars %>%
dplyr::select(mt, mpg)
")
#>
#> mtcars %>%
#>
#> dplyr::select(mt, mpg) Created on 2020-06-05 by the reprex package (v0.3.0) |
I agree. Wanna make a PR? You'd probably need to tweak |
Sorry, unfortunately, I don't know enough about |
No problem. I’ll try to do it on the weekend and you can see the diff.
… On 5 Jun 2020, at 18:25, Indrajeet Patil ***@***.***> wrote:
Sorry, unfortunately, I don't know enough about styler's internal code to be of any help in making a PR. :(
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Related: #632 |
- No more than one line break between pipes (#627).
@IndrajeetPatil wanna have a look at #645 and try it out. It's merged into master. |
Das ist perfekt! :) styler::style_text("
mtcars %>%
dplyr::select(mt, mpg)
")
#>
#> mtcars %>%
#> dplyr::select(mt, mpg) Thanks for implementing these feature requests. |
@lorenzwalthert For some reason, this doesn't work with the styler::style_text("
mtcars %<>%
dplyr::select(mt, mpg)
")
#>
#> mtcars %<>%
#>
#> dplyr::select(mt, mpg) Created on 2020-10-01 by the reprex package (v0.3.0.9001) |
Because it was not implemented for any infix operator, just for |
I am not sure if this should be a separate issue, but it's very related, so I will also post it here: I'd expect the following styler::style_text("df <-
mtcars %>%
dplyr::filter(am == 0)")
#> df <-
#>
#> mtcars %>%
#> dplyr::filter(am == 0) Created on 2020-10-21 by the reprex package (v0.3.0.9001) to be instead styled as- #> df <-
#> mtcars %>%
#> dplyr::filter(am == 0) Does that make sense? |
It does make sense yes but it's technically a different thing (line breaks in assignments), so please file a separate issue. |
Thanks @IndrajeetPatil. |
Not sure what the
tidyverse
style guide says here, but sometimes I want to remove some function arguments I had specified at multiple places in a script and then styling the file doesn't remove those empty lines.Is this something that
styler
should be doing?Created on 2020-04-08 by the reprex package (v0.3.0.9001)
Session info
The text was updated successfully, but these errors were encountered: