-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
@@ -21,6 +21,7 @@ | |||
|
|||
### Bugs fixed | |||
|
|||
* [#1256](https://github.com/bbatsov/rubocop/issues/1256): Ignore block-pass in `TrailingComma`. ([@tamird][]) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, right
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Ignore block-pass in `TrailingComma`
👍 |
Trailing commas after a block-pass are a parse error, so we must
special-case them. @yous @bbatsov