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

Add same_line style for multiline brace layouts #3052

Merged
merged 1 commit into from
Apr 22, 2016

Conversation

panthomakos
Copy link
Contributor

The Style/Multiline*BraceLayout cops now supports the same_line
enforced style. This style forces the closing brace to always be on the
same line as the last element.

For reference see #2914

@panthomakos panthomakos force-pushed the brace-layout-same-line branch 2 times, most recently from 60acaf6 to d7fdc6a Compare April 15, 2016 19:22
add_offense(node, :expression, self.class::ALWAYS_NEW_LINE_MESSAGE)
end

def handle_same_line(node)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this code was added. The rest of the code has been moved from check_brace_layout for clarity.

The `Style/Multiline*BraceLayout` cops now supports the `same_line`
enforced style. This style forces the closing brace to always be on the
same line as the last element.

For reference see rubocop#2914
@panthomakos panthomakos force-pushed the brace-layout-same-line branch from d7fdc6a to 705b922 Compare April 15, 2016 23:58
@bbatsov bbatsov merged commit 027e989 into rubocop:master Apr 22, 2016
Neodelf pushed a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016
The `Style/Multiline*BraceLayout` cops now supports the `same_line`
enforced style. This style forces the closing brace to always be on the
same line as the last element.

For reference see rubocop#2914
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

Successfully merging this pull request may close these issues.

2 participants