-
Notifications
You must be signed in to change notification settings - Fork 26.6k
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
put the dot with fn name when chaining #230
Conversation
👍 because I like this PR but also to spite @horaceko |
👎 to this PR but 👍 to spite @horaceko In all seriousness, I'm actually largely indifferent, and I defer to the opinion of the masses. |
👍 |
@justjake could you change |
b0d48bd
to
33363af
Compare
@hshoff k |
put the dot with fn name when chaining
🍻 |
I think both options should be valid. Ruby style guide consider both ok: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Two reasons I like using dot in the first line of each line:
|
@rafaelsales idiomatic ruby styles can be problematic for a number of reasons, so that's not a point in its favor. Our guide requires either a) everything fits on one line, or b) each thing goes on its own line. In other words,
is invalid - it must either be
In addition, our guide and linter rules require the dot to begin the next line - we never permit the dot to trail on the end. |
You could have summarized your answer in one line: "Our rule is the one you can find in the readme" I was trying to start a discussion here showing the other style also has advantages over the current one, thus shouldn't be considered "bad" as the README says. Instead it should be offered as just another option that certain teams can adopt and still be able to say "we follow airbnb style guide" |
Fair enough :-) I don't think that the other style has advantages, and I highly dislike it in Ruby as well. As far as I'm aware, the only reason that style became popular in Ruby is because some old version of Ruby or earlier (i forget which) didn't support the "leading dots" style. Now that Ruby supports it, I think that's the style that should be used in both JS and Ruby. As to your specific reasons:
If someone wants to be able to say "we follow the airbnb style guide", they have to cleave to our rules - and that includes using "leading dots". |
Reasons: