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

rubocop -a breaks the following program #1879

Closed
dcu opened this issue May 9, 2015 · 2 comments
Closed

rubocop -a breaks the following program #1879

dcu opened this issue May 9, 2015 · 2 comments
Assignees
Labels

Comments

@dcu
Copy link

dcu commented May 9, 2015

The following example is broken after running rubocop -a:

def foo
  bar 1, { 'a' => 1, 'b' => 2, }
end

def bar(a,b)
  puts a.inspect
  puts b.inspect
end

foo

it's converted to this:

def foo
  bar 1, 'a' => 1, 'b' => 2,
end

def bar(a,b)
  puts a.inspect
  puts b.inspect
end

foo
@jonas054 jonas054 added the bug label May 9, 2015
@jonas054 jonas054 self-assigned this May 9, 2015
@l8nite
Copy link

l8nite commented May 15, 2015

Ran into this today too. Looks like we need to omit the trailing comma when removing redundant braces.

-set :default_env, {
-  path: "/opt/rbenv/shims:/opt/rbenv/bin:$PATH",
-}
-set :migrate_env, {
-  'DEPLOY' => true
-}
+set :default_env,   path: "/opt/rbenv/shims:/opt/rbenv/bin:$PATH",
+set :migrate_env,   'DEPLOY' => true

@jonas054
Copy link
Collaborator

This has been fixed in #1881 but I made a mistake in the reference to this issue, which is why it's still open. Closing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants