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
Error in Style/MethodCallWithArgsParentheses (with Autocorrect) #5951
Error in Style/MethodCallWithArgsParentheses (with Autocorrect) #5951
Comments
@pdobb Could you run RuboCop with |
@Drenmi Thanks, that's a useful flag! It's caused by class MyTestClass
def my_method
raise NotImplementedError
end
end Update: |
I also see
For e.g. class MyTestClass
def my_method
%w[a b].each do |letter|
Object.new.build letter
end
end
end If I remove the |
Thanks @pdobb! I can reproduce both issues on |
Similar issue with:
Given a class MyTestClass
def my_method
sleep 1
end
end I'll stop there unless you want me to keep on going. Thanks! |
Seems like they are all the same class of issue. I suspect any additional examples will point to the same root cause. 🙂 |
…aising error in some cases This cop would raise an error when auto-correcting certain constructs, such as: ``` def foo sleep 1 end ``` This was happening because some of the Parser source maps are missing the `begin` keyword.
When running
rubocop --auto-correct
with the following settings:I receive an exception:
Expected behavior
I expect Style/MethodCallWithArgsParentheses cop to complete without exception, as per usual.
Actual behavior
I get a Parser error part way through the auto-correct procedure. That is, it fixes some number of issues and then at some point fails with:
Steps to reproduce the problem
I'm actually not sure what is causing this, exactly. Each time I run
rubocop --auto-correct
in my project with Style/MethodCallWithArgsParentheses enabled I see the above exception, though. I don't see the exception if I don't use autocorrection.Sorry, not sure how I can be more helpful here. Will report back if I find something of use.
RuboCop version
The text was updated successfully, but these errors were encountered: