-
Notifications
You must be signed in to change notification settings - Fork 90
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
Option to not switch Ruby blocks to do/end when chained #124
Comments
While I wouldn't call it "bad syntax", I think you have a point that the curly brace syntax is more common, particularly for rspec expectations. I'd prefer to split like that myself, I think, if there's a chain. It definitely makes sense to open the issue. That said, it's tricky. Not the splitting thing, that one is easy, but joining complicates things, because it's hard to differentiate between hashes and blocks when they're like this. I've created a branch, ruby-blocks-in-method-chains, where I've implemented this, with a setting, and a help file. Could you use it for a while, let me know how it works? If there are issues, there's a few more things I can try, but I'd like to have specific examples to work with. |
Ya, I've been using it a bit and I haven't seen any problems. I'll keep using it for a week or so and I'll let you know what I find. |
I have been using this for a while, and it does do the correct thing for curly braces that are chained. I have noticed some other bugs, which I'm not sure if they are related to this change. I am working on some ways to reproduce the issues. |
Currently when spliting something like this:
it produces:
Chaining on
end
is usually considered bad syntax. The expected split would be:In my opinion this should be the default, but if you wanted to keep it how it is for backwards compatibility an options would be nice to toggle this behavior.
The text was updated successfully, but these errors were encountered: