You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
styler fails to correctly style syntactic rlang sugar {{ #526
Thanks guys. Is there a rule in the tidyverse style guide planned? I think we can implement the suggested style from @lionel- without much work. Is {{ space or line break in-sensitive, i.e. does it have the same meaning as { { or {\n{ or does styler currently change the meaning in the example demonstrated by @ellessenne?
...I just think the latter is ugly! 😃 Jokes aside, I think the {{ }} operator should not be broken into multiple lines - otherwise it becomes counter-intuitive?
I agree that styler's current behavior is not ideal, but I simply asked because if the result would change, the issue would have been much more urgent to fix. We are definitively going to so something about it. I think the consensus is:
leave {{ as is.
remove spaces after first and third brace.
add space after second and before third brace.
remove line breaks within.
For details of the implementation, see #528 or ?set_space_in_curly_curly().
not sure about {\n{ and similar, but probably it should also be turned into {{ with strict = TRUE in styler::tidyverse_style().
Activity
lionel- commentedon Jun 27, 2019
We're currently leaning towards
foo({{ var }}).lorenzwalthert commentedon Jun 27, 2019
Thanks guys. Is there a rule in the tidyverse style guide planned? I think we can implement the suggested style from @lionel- without much work. Is
{{space or line break in-sensitive, i.e. does it have the same meaning as{ {or{\n{or does styler currently change the meaning in the example demonstrated by @ellessenne?ellessenne commentedon Jun 28, 2019
The two examples return the same result:
Created on 2019-06-28 by the reprex package (v0.3.0)
...I just think the latter is ugly! 😃 Jokes aside, I think the
{{ }}operator should not be broken into multiple lines - otherwise it becomes counter-intuitive?lorenzwalthert commentedon Jun 29, 2019
I agree that styler's current behavior is not ideal, but I simply asked because if the result would change, the issue would have been much more urgent to fix. We are definitively going to so something about it. I think the consensus is:
{{as is.For details of the implementation, see #528 or
?set_space_in_curly_curly().not sure about{\n{and similar, but probably it should also be turned into{{withstrict = TRUEinstyler::tidyverse_style().[-]Issues when styling {{ }} operator of rlang[/-][+]styler fails to correctly style syntactic rlang sugar {{[/+]