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

Misautocorrection by Style/Block #1441

Closed
mvz opened this issue Nov 11, 2014 · 1 comment
Closed

Misautocorrection by Style/Block #1441

mvz opened this issue Nov 11, 2014 · 1 comment
Assignees
Labels

Comments

@mvz
Copy link
Contributor

mvz commented Nov 11, 2014

In autocorrect mode, the Style/Block cop corrects the following code:

foo :bar, :baz, qux: lambda { |a|
  bar a
}

The result is:

foo :bar, :baz, qux: lambda do |a|
  bar a
end

This gives an error in Ruby:

[matijs@walnut]  ruby test_rubocop.rb
test_rubocop.rb:1:in `lambda': tried to create Proc object without a block (ArgumentError)
    from test_rubocop.rb:1:in `<main>'

The Rubocop version output is:

[matijs@walnut] rubocop -V
warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.4-compliant syntax, but you are running 2.1.3.
0.27.1 (using Parser 2.2.0.pre.7, running on ruby 2.1.3 x86_64-linux)
@jonas054
Copy link
Collaborator

Mine!

@jonas054 jonas054 self-assigned this Nov 11, 2014
@jonas054 jonas054 added the bug label Nov 11, 2014
bbatsov added a commit that referenced this issue Nov 12, 2014
[Fix #1441] Compare AST for whole buffer in AutocorrectUnlessChangingAST
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

2 participants