-
Notifications
You must be signed in to change notification settings - Fork 56
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
alignment agnosticism #90
Comments
For what it's worth, I agree with @jrochkind on this one. I have a ton of code like this (assignment with if, case, or begin). Though really I'm just happy to have auto-formatting of any kind :) |
What I do in case for the time being:
This is reasonable for me. |
I agree with the OP. Just opened up this duplicate issue before realizing that this issue already addresses it. You can see some specific examples where the current formatting is a real problem (at least from my perspective) here: #119 Personally, I can't use rufo with the current enforcement. |
I love rufo's approach, but won't continue with it because of this reason. In fact, I don't really care about indentation, but I found that it was indenting to places other than tab stops, so to add code, I couldn't simply things = if xyz
abcd
else
efgh
end Since the number of spaces before |
Been looking into this issue and would like to get some feedback on what we should do here. I can see two options that seem like good approaches. Option 1The first is what @martinos suggests above: a =
if true
1
else
2
end
a_really_long_name =
if true
1
else
2
end Pros
< a =
---
> a_new_name = Option 2Keep the first line of the expression on the same line as the assignment. a = if true
1
else
2
end
a_really_long_name = if true
1
else
2
end
Pros
< a = if true
---
> a_new_name = if true Cons
Option 3a = if true
1
else
2
end
a_really_long_name = if true
1
else
2
end
Pros
Cons
|
Decided to go with Option 2 |
This is a great project, thanks. I like that it tries to respect some alignment choices agnostically, Unobtrusive by default.
Trying it out on my code, here is one choice where it doesn't:
This seems reasonable to me, but rufo insists on:
thoughts? Maybe I'm wrong that this is reasonable!
The text was updated successfully, but these errors were encountered: