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

Ignore block-pass in TrailingComma #1256

Merged
merged 1 commit into from
Aug 9, 2014
Merged

Ignore block-pass in TrailingComma #1256

merged 1 commit into from
Aug 9, 2014

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Aug 8, 2014

Trailing commas after a block-pass are a parse error, so we must
special-case them. @yous @bbatsov

@@ -21,6 +21,7 @@

### Bugs fixed

* [#1256](https://github.com/bbatsov/rubocop/issues/1256): Ignore block-pass in `TrailingComma`. ([@tamird][])
Copy link
Contributor

Choose a reason for hiding this comment

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

This line should be at the bottom of entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, right

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 584642bb46e0fecede0bd52c89afe427de77eb16 on tamird:trailing-commas-block into 5a5215b on bbatsov:master.

@@ -127,7 +127,10 @@ def avoid_comma(kind, comma_begin_pos, sb, extra_info)
end

def put_comma(items, kind, sb)
last_expr = items.last.loc.expression
item = items.last
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't last_item be a better name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Trailing commas after a block-pass are a parse error, so we must
special-case them.
bbatsov added a commit that referenced this pull request Aug 9, 2014
Ignore block-pass in `TrailingComma`
@bbatsov bbatsov merged commit 5d1bf0f into rubocop:master Aug 9, 2014
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 9, 2014

👍

@tamird tamird deleted the trailing-commas-block branch August 9, 2014 17:47
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.

4 participants