Skip to content
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

Clarification of new-lining parens and curly braces #7

Closed
gylaz opened this issue Sep 4, 2012 · 4 comments
Closed

Clarification of new-lining parens and curly braces #7

gylaz opened this issue Sep 4, 2012 · 4 comments

Comments

@gylaz
Copy link
Contributor

gylaz commented Sep 4, 2012

Are we talking about keeping both the open and the closed parentheses on their own new lines? What about the curly braces?

If we're only talking about the closing paren/curly, then I would suggest specifying that.

@sikachu
Copy link
Contributor

sikachu commented Sep 4, 2012

Can you give us some example of the code you're talking about?

@gylaz
Copy link
Contributor Author

gylaz commented Sep 4, 2012

This is the current wording:

  • If you break up an argument list, keep the parenthesis on its own line.
  • If you break up a hash, keep the curly braces on their own lines.

From reading the above I can understand the following:

user = User.new
user.attributes =
{
  first_name: 'Lance',
  last_name: 'Armstrong',
  body_build: 'athletic'
}

or:

user = User.new
user.attributes = {
  first_name: 'Lance',
  last_name: 'Armstrong',
  body_build: 'athletic'
}

I assume the second variation is correct, where only the closing curly braces (or paren) is kept on it's own new line. If so, i'm proposing is re-wording the two bullet points to this:

  • If you break up an argument list, keep the closing parenthesis on its own line.
  • If you break up a hash, keep the closing curly brace on its own line.

@croaky
Copy link
Contributor

croaky commented Sep 5, 2012

The proposed re-wording makes sense to me.

@croaky
Copy link
Contributor

croaky commented Oct 2, 2012

Thanks, @gylaz. I've improved the wording at your suggestion.

@croaky croaky closed this as completed Oct 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants