-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't force the first switch argument in-line with switch( #858
Comments
I am happy to keep it if on a separate line. Cn you file a PR? |
Sure, I will give it a go. It will take a while to get to it. |
Let me know how I can help. Most likely the diff for #714 is a good starting point. |
It also seems like
|
One liners are explicitly discouraged in the type guide, see #714 (comment). |
Thanks, that's unfortunate, it really is a huge waste of space for cases when it can fit inline. I'll file upstream -- the one-line examples in the guide all use fall-through, where I can see the case for splitting it out more easily. |
@MichaelChirico can you add the reference to the issue in https://github.com/tidyverse/style here? |
That's tidyverse/style#181 |
I think we've hewed too closely to the style guide after #714:
Understand the
switch()
example in the style guide is like that, but I think both havingx
on its own line and moving it toswitch(x
are acceptable per the overall style guide, sostyler
shouldn't override valid syntax.My reasoning is per: https://style.tidyverse.org/syntax.html#long-lines
This becomes worse when the first argument is an expression, not just a symbol:
Here I think the original version is much clearer.
The text was updated successfully, but these errors were encountered: