-
Notifications
You must be signed in to change notification settings - Fork 186
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
Allowing lone curly braces in some cases #487
Comments
The simplest fix would be to make your .lintr more lenient:
As an aside, |
this would be the other extreme though right, where that linting rule is simply shut off in all cases? |
Yes. To achieve your use-case, I believe we'd have to modify |
Another use case of this is passing a multi-line code block to a function:
Or is there a better way to format this code? |
Another example using > styler::style_text("tryCatch({print(1)},error=function(err){})")
tryCatch(
{
print(1)
},
error = function(err) {}
) |
@AshesITR did you intentionally not include |
@bersbersbers I forgot. Made a quick-fix #1121 |
This comment was marked as outdated.
This comment was marked as outdated.
Correcting myself: 024ecf3 works great for the first issue, and |
Thanks, d52614e on main works great! |
I think the curly brace alone is the most readable in some cases. Particularly I came across this writing a
switch
where the default is multiline:Is there any option to turn off this failure for this case? This alternative I think is not very readable:
There was also a request for exceptions in a case like
with
(though I would still use EOL-{
in that case personally):#188 (comment)
The text was updated successfully, but these errors were encountered: