-
Notifications
You must be signed in to change notification settings - Fork 71
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
Unnecessary brackets inside substitute expressions #889
Comments
Thanks @kpagacz. Indeed it was fixed in #876, but only for code where the expression of concern was a direct child of library(magrittr)
expr <- substitute(
expr = {
# styler: off
iris %>%
exprA %>%
exprB
},
# styler: on
env = list(exprA = call("summary"), exprB = call("print"))
) |
Actually this does not work either because of another bug 😮💨... I |
Having had a look at the unit tests and the styler code, I think I now understand why #876 does not work as I suspected. Thanks a lot for the feedback. I actually filed this issue because styler: off and styler: on threw errors for me when I tried using it with substitute, so I felt like I was trapped to suffer manually reverting styler changes for every substitute occurrence. I have tested on the latest main branch and I can now use |
This PR #876 supposedly fixes the issue of
styler
putting additional, unnecessary brackets inside substitute expressions. But having installed the latest version of styler from main, I am still experiencing the issue described in #873Here is my reprex:
Styler styles it to:
Here's my sessionInfo:
The text was updated successfully, but these errors were encountered: